Access Shopper Data

Bolt’s Account APIs enable the store’s backend to read account details and perform account actions on behalf of a shopper. To access these APIs, provision a token with Bolt OAuth so your store backend can send the account data to your frontend and render a one-click checkout experience.

1. Read the Shopper’s Bolt Account Details

The Account Details API provides account data associated with the shopper, including shopper identity, shopper addresses, and shopper payment methods.

The Bolt access token authorizes your application and identifies the shopper; it is the only parameter used for reading account details.

curl -X GET -H "X-Api-Key: $APIKEY" -H "Authorization: bearer \
$requestToken" https://api-sandbox.bolt.com/v1/account

Response

Each returned shopper address object contains a shopper_address_id. Similarly, each returned credit card object will contain a credit_card_id.

To charge a shopper’s existing credit card or use a shopper’s existing address, you’ll need to pass both the shipping_address_id and the credit_card_id into the Authorize Payment API.


Success



Error


2. Add an Address to the Shopper’s Bolt Account

The Add Address API enables you to add an address to a shopper’s Bolt account.

curl -X POST -H "X-Api-Key: $APIKEY" -H \
"Authorization: bearer $requestToken" -H \
"Content-Type: application/json" \
https://api-sandbox.bolt.com/v1/account/addresses -d \
'{"street_address1":"124 N Main St","locality":"Houston",\
"region":"Texas","postal_code":"77002","country_code":"US",\
"country":"United States","name":"Test User","first_name":"Test",\
"last_name":"User","phone_number":"8325555554",\
"email_address":"sampleuser@example.com"}'

Response

This endpoint returns an address object containing a shipping_address_id, which can be used for future payment authorization.


Example Response


3. Add Payment Method to the Shopper’s Bolt Account

The Add Payment Method API will give you the ability to add a payment method to a Bolt Account.

Response

This endpoint will return a credit card object containing a credit_card_id, which can be used for future Payment Authorization.

The Add Payment Method API requires a Bolt credit card token as an input. To exchange raw credit card information for a credit card token, implement payment fields.

Next Step

After you access Shopper Data, you will need to implement Payment Fields. This is a Front End Embedded Component that enables both logged-in and guest shoppers to transact with the merchant’s storefront.

📖On This Page