# account.create_complete

> Create or update a shopper account with profile information, payment and addresses.

Source: https://help.boltapp.com/api-reference/merchant-callback-reference/account/account-create-complete

`POST /account_upsert`

## OpenAPI definition

This endpoint as it appears in the OpenAPI document, with every schema it references included.

```json
{
  "openapi": "3.2.0",
  "info": {
    "version": "1.0.0",
    "title": "Merchant Callback API Reference",
    "description": "## About\nThe Merchant Callback API is a general endpoint on your eCommerce server that Bolt calls to receive information necessary for operating the checkout process.\n\n**Note**: You must also reference the [Bolt API](/api-bolt) when building a custom cart integration.\n\n### URL Options\nYou can set the URL(s) for your Merchant Callback API in the [Bolt Merchant dashboard](https://merchant.boltapp.com).\n- **v1**: v1 endpoints are individualized and described in the subsections below with unique URLs (e.g., `/order_shipping_and_tax`)\n- **Universal**: The \"Universal API\" is one endpoint (instead of many) that handles all events described in this spec; the methods and payloads are identical, however you only need to use one URL.\n\nNeed more information? See our [Developer reference articles](/developers/references/) for **environment details**, **error codes**, and more.\n"
  },
  "servers": [
    {
      "url": "https://merchant-url.com/api"
    }
  ],
  "paths": {
    "/account_upsert": {
      "post": {
        "tags": [
          "Account"
        ],
        "x-speakeasy-ignore": true,
        "summary": "account.create_complete",
        "operationId": "account.create_complete",
        "description": "Create or update a shopper account with profile information, payment and addresses.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/bolt_hmac_param"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/account_create_complete"
        },
        "responses": {
          "200": {
            "description": "The account details were successfully created/updated"
          },
          "4XX": {
            "description": "An error has occurred, and further details are contained in the response."
          },
          "default": {
            "description": "An error has occurred, and further details are contained in the response."
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "bolt_hmac_param": {
        "in": "header",
        "name": "X-Bolt-Hmac-Sha256",
        "schema": {
          "type": "string"
        },
        "description": "Bolt sends a signed HMAC for hook verification"
      }
    },
    "requestBodies": {
      "account_create_complete": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "event": {
                  "type": "string",
                  "enum": [
                    "account.create_complete"
                  ]
                },
                "data": {
                  "$ref": "#/components/schemas/create-full-account"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "create-full-account": {
        "type": "object",
        "properties": {
          "account_details": {
            "$ref": "#/components/schemas/account"
          },
          "customer_data_id": {
            "type": "string",
            "description": "A unique identifier for this account on the merchant platform.",
            "examples": [
              "5FEB9028D"
            ]
          }
        }
      },
      "account": {
        "type": "object",
        "required": [
          "addresses",
          "payment_methods"
        ],
        "properties": {
          "addresses": {
            "type": "array",
            "description": "A list of addresses associated with this account.",
            "items": {
              "$ref": "#/components/schemas/address-listing"
            }
          },
          "payment_methods": {
            "type": "array",
            "description": "A list of payment methods associated with this account.",
            "items": {
              "$ref": "#/components/schemas/payment-method"
            }
          },
          "profile": {
            "$ref": "#/components/schemas/profile"
          }
        }
      },
      "address-listing": {
        "type": "object",
        "description": "An address saved on an account, i.e. a physical address plus any additional account-specific metadata.",
        "allOf": [
          {
            "$ref": "#/components/schemas/address"
          },
          {
            "type": "object",
            "properties": {
              "phone": {
                "type": "string",
                "format": "phone",
                "description": "The phone number associated with this address.",
                "x-oapi-codegen-extra-tags": {
                  "validate": "phone=strict"
                },
                "examples": [
                  "+14155550199"
                ]
              },
              "is_default": {
                "type": "boolean",
                "description": "Whether or not this is the default address saved.",
                "examples": [
                  true
                ]
              }
            }
          }
        ]
      },
      "address": {
        "type": "object",
        "description": "A physical address.",
        "required": [
          "id",
          "first_name",
          "last_name",
          "street_address1",
          "locality",
          "postal_code",
          "country_code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "id",
            "description": "The address's unique identifier.",
            "readOnly": true,
            "examples": [
              "D4g3h5tBuVYK9"
            ]
          },
          "first_name": {
            "type": "string",
            "description": "The first name of the person associated with this address.",
            "examples": [
              "Alice"
            ]
          },
          "last_name": {
            "type": "string",
            "description": "The last name of the person associated with this address.",
            "examples": [
              "Baker"
            ]
          },
          "company": {
            "type": "string",
            "description": "The company associated with this address.",
            "examples": [
              "ACME Corporation"
            ]
          },
          "street_address1": {
            "type": "string",
            "description": "The street address associated with this address.",
            "examples": [
              "535 Mission St, Ste 1401"
            ]
          },
          "street_address2": {
            "type": "string",
            "description": "Any additional, optional, street address information associated with this address.",
            "examples": [
              "c/o Shipping Department"
            ]
          },
          "locality": {
            "type": "string",
            "description": "The locality (e.g. city, town, etc...) associated with this address.",
            "examples": [
              "San Francisco"
            ]
          },
          "postal_code": {
            "type": "string",
            "description": "The postal code associated with this address.",
            "examples": [
              "94105"
            ]
          },
          "region": {
            "type": "string",
            "description": "The region or administrative area (e.g. state, province, county, etc...) associated with this address.",
            "examples": [
              "CA"
            ]
          },
          "country_code": {
            "type": "string",
            "description": "The country (in its ISO 3166 alpha-2 format) associated with this address.",
            "enum": [
              "AF",
              "AX",
              "AL",
              "DZ",
              "AS",
              "AD",
              "AO",
              "AI",
              "AQ",
              "AG",
              "AR",
              "AM",
              "AW",
              "AU",
              "AT",
              "AZ",
              "BH",
              "BS",
              "BD",
              "BB",
              "BY",
              "BE",
              "BZ",
              "BJ",
              "BM",
              "BT",
              "BO",
              "BQ",
              "BA",
              "BW",
              "BV",
              "BR",
              "IO",
              "BN",
              "BG",
              "BF",
              "BI",
              "KH",
              "CM",
              "CA",
              "CV",
              "KY",
              "CF",
              "TD",
              "CL",
              "CN",
              "CX",
              "CC",
              "CO",
              "KM",
              "CG",
              "CD",
              "CK",
              "CR",
              "CI",
              "HR",
              "CU",
              "CW",
              "CY",
              "CZ",
              "DK",
              "DJ",
              "DM",
              "DO",
              "EC",
              "EG",
              "SV",
              "GQ",
              "ER",
              "EE",
              "ET",
              "FK",
              "FO",
              "FJ",
              "FI",
              "FR",
              "GF",
              "PF",
              "TF",
              "GA",
              "GM",
              "GE",
              "DE",
              "GH",
              "GI",
              "GR",
              "GL",
              "GD",
              "GP",
              "GU",
              "GT",
              "GG",
              "GN",
              "GW",
              "GY",
              "HT",
              "HM",
              "VA",
              "HN",
              "HK",
              "HU",
              "IS",
              "IN",
              "ID",
              "IR",
              "IQ",
              "IE",
              "IM",
              "IL",
              "IT",
              "JM",
              "JP",
              "JE",
              "JO",
              "KZ",
              "KE",
              "KI",
              "KP",
              "KR",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LS",
              "LR",
              "LY",
              "LI",
              "LT",
              "LU",
              "MO",
              "MK",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MH",
              "MQ",
              "MR",
              "MU",
              "YT",
              "MX",
              "FM",
              "MD",
              "MC",
              "MN",
              "ME",
              "MS",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NR",
              "NP",
              "NL",
              "NC",
              "NZ",
              "NI",
              "NE",
              "NG",
              "NU",
              "NF",
              "MP",
              "NO",
              "OM",
              "PK",
              "PW",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PN",
              "PL",
              "PT",
              "PR",
              "QA",
              "RE",
              "RO",
              "RU",
              "RW",
              "BL",
              "SH",
              "KN",
              "LC",
              "MF",
              "PM",
              "VC",
              "WS",
              "SM",
              "ST",
              "SA",
              "SN",
              "RS",
              "SC",
              "SL",
              "SG",
              "SX",
              "SK",
              "SI",
              "SB",
              "SO",
              "ZA",
              "GS",
              "SS",
              "ES",
              "LK",
              "SD",
              "SR",
              "SJ",
              "SZ",
              "SE",
              "CH",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TL",
              "TG",
              "TK",
              "TO",
              "TT",
              "TN",
              "TR",
              "TM",
              "TC",
              "TV",
              "UG",
              "UA",
              "AE",
              "GB",
              "US",
              "UM",
              "UY",
              "UZ",
              "VU",
              "VE",
              "VN",
              "VG",
              "VI",
              "WF",
              "EH",
              "YE",
              "ZM",
              "ZW"
            ],
            "x-oapi-codegen-extra-tags": {
              "validate": "country"
            },
            "examples": [
              "US"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The email address associated with this address.",
            "examples": [
              "alice@example.com"
            ]
          },
          "phone": {
            "type": "string",
            "format": "phone",
            "description": "The phone number associated with this address.",
            "examples": [
              "+14155550199"
            ]
          }
        }
      },
      "payment-method": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/payment-method-credit-card"
          },
          {
            "$ref": "#/components/schemas/payment-method-paypal"
          },
          {
            "$ref": "#/components/schemas/payment-method-affirm"
          },
          {
            "$ref": "#/components/schemas/payment-method-afterpay"
          },
          {
            "$ref": "#/components/schemas/payment-method-klarna"
          },
          {
            "$ref": "#/components/schemas/payment-method-klarna-account"
          },
          {
            "$ref": "#/components/schemas/payment-method-klarna-paynow"
          }
        ],
        "discriminator": {
          "propertyName": ".tag",
          "mapping": {
            "credit_card": "#/components/schemas/payment-method-credit-card",
            "paypal": "#/components/schemas/payment-method-paypal",
            "affirm": "#/components/schemas/payment-method-affirm",
            "afterpay": "#/components/schemas/payment-method-afterpay",
            "klarna": "#/components/schemas/payment-method-klarna",
            "klarna_account": "#/components/schemas/payment-method-klarna-account",
            "klarna_paynow": "#/components/schemas/payment-method-klarna-paynow"
          }
        }
      },
      "payment-method-credit-card": {
        "allOf": [
          {
            "type": "object",
            "required": [
              ".tag",
              "type",
              "billing_address"
            ],
            "properties": {
              ".tag": {
                "type": "string",
                "enum": [
                  "credit_card"
                ],
                "examples": [
                  "credit_card"
                ]
              },
              "id": {
                "type": "string",
                "format": "id",
                "readOnly": true,
                "examples": [
                  "X5h6j8uLpVGK"
                ]
              },
              "billing_address": {
                "$ref": "#/components/schemas/address-reference"
              }
            }
          },
          {
            "$ref": "#/components/schemas/credit-card"
          }
        ]
      },
      "address-reference": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/address-reference-id"
          },
          {
            "$ref": "#/components/schemas/address-reference-explicit"
          }
        ],
        "discriminator": {
          "propertyName": ".tag",
          "mapping": {
            "id": "#/components/schemas/address-reference-id",
            "explicit": "#/components/schemas/address-reference-explicit"
          }
        }
      },
      "address-reference-id": {
        "type": "object",
        "required": [
          ".tag",
          "id"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "id"
            ],
            "description": "The type of address reference",
            "examples": [
              "id"
            ]
          },
          "id": {
            "type": "string",
            "format": "id",
            "description": "The address's ID",
            "examples": [
              "D4g3h5tBuVYK9"
            ]
          }
        }
      },
      "address-reference-explicit": {
        "allOf": [
          {
            "type": "object",
            "required": [
              ".tag"
            ],
            "properties": {
              ".tag": {
                "type": "string",
                "enum": [
                  "explicit"
                ],
                "description": "The type of address reference",
                "examples": [
                  "explicit"
                ]
              }
            }
          },
          {
            "$ref": "#/components/schemas/address"
          }
        ]
      },
      "credit-card": {
        "required": [
          "network",
          "bin",
          "last4",
          "expiration",
          "token"
        ],
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "description": "The credit card's network.",
            "enum": [
              "visa",
              "mastercard",
              "amex",
              "discover",
              "jcb",
              "unionpay",
              "alliancedata",
              "citiplcc"
            ],
            "examples": [
              "visa"
            ]
          },
          "bin": {
            "type": "string",
            "description": "The Bank Identification Number (BIN). This is typically the first 4 to 6 digits of the account number.",
            "writeOnly": true,
            "pattern": "^\\d+$",
            "examples": [
              "411111"
            ]
          },
          "last4": {
            "type": "string",
            "description": "The account number's last four digits.",
            "pattern": "^\\d{4}$",
            "examples": [
              "1004"
            ]
          },
          "expiration": {
            "type": "string",
            "description": "The expiration date, in YYYY-MM format.",
            "pattern": "^\\d{4}-\\d{2}$",
            "examples": [
              "2029-03"
            ]
          },
          "token": {
            "type": "string",
            "description": "The Bolt token associated with the credit card.",
            "writeOnly": true,
            "examples": [
              "a1B2c3D4e5F6G7H8i9J0k1L2m3N4o5P6Q7r8S9t0"
            ]
          }
        }
      },
      "payment-method-paypal": {
        "type": "object",
        "required": [
          ".tag",
          "success",
          "cancel"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "paypal"
            ],
            "examples": [
              "paypal"
            ]
          },
          "success_url": {
            "type": "string",
            "description": "Redirect URL for successful PayPal transaction.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_paypal_success"
            ]
          },
          "cancel_url": {
            "type": "string",
            "description": "Redirect URL for canceled PayPal transaction.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_paypal_cancel"
            ]
          }
        }
      },
      "payment-method-affirm": {
        "type": "object",
        "required": [
          ".tag",
          "return_url"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "affirm"
            ],
            "examples": [
              "affirm"
            ]
          },
          "return_url": {
            "type": "string",
            "description": "Return URL to return to after payment completion in Affirm.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_affirm_success"
            ]
          }
        }
      },
      "payment-method-afterpay": {
        "type": "object",
        "required": [
          ".tag",
          "return_url"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "afterpay"
            ],
            "examples": [
              "afterpay"
            ]
          },
          "return_url": {
            "type": "string",
            "description": "Return URL to return to after payment completion in Afterpay.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_afterpay_success"
            ]
          }
        }
      },
      "payment-method-klarna": {
        "type": "object",
        "required": [
          ".tag",
          "return_url"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "klarna"
            ],
            "examples": [
              "klarna"
            ]
          },
          "return_url": {
            "type": "string",
            "description": "Return URL to return to after payment completion in Klarna.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_klarna_success"
            ]
          }
        }
      },
      "payment-method-klarna-account": {
        "type": "object",
        "required": [
          ".tag",
          "return_url"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "klarna_account"
            ],
            "examples": [
              "klarna_account"
            ]
          },
          "return_url": {
            "type": "string",
            "description": "Return URL to return to after payment completion in Klarna.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_klarna_account_success"
            ]
          }
        }
      },
      "payment-method-klarna-paynow": {
        "type": "object",
        "required": [
          ".tag",
          "return_url"
        ],
        "properties": {
          ".tag": {
            "type": "string",
            "enum": [
              "klarna_paynow"
            ],
            "examples": [
              "klarna_paynow"
            ]
          },
          "return_url": {
            "type": "string",
            "description": "Return URL to return to after payment completion in Klarna.",
            "format": "uri",
            "writeOnly": true,
            "examples": [
              "www.example.com/handle_klarna_paynow_success"
            ]
          }
        }
      },
      "profile": {
        "type": "object",
        "required": [
          "first_name",
          "last_name",
          "email"
        ],
        "properties": {
          "first_name": {
            "type": "string",
            "description": "The given name of the person associated with this profile.",
            "examples": [
              "Alice"
            ]
          },
          "last_name": {
            "type": "string",
            "description": "The last name of the person associated with this profile.",
            "examples": [
              "Baker"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The email address asscoiated with this profile.",
            "examples": [
              "alice@example.com"
            ]
          },
          "phone": {
            "type": "string",
            "format": "phone",
            "description": "The phone number associated with this profile.",
            "examples": [
              "+14155550199"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard."
      }
    }
  }
}
```
