(Account)
Use the Accounts API to access shoppers' accounts to empower your checkout and facilitate shoppers' choices.
Retrieve a shopper's account details, such as addresses and payment information. The account's details are filtered to be relevant to your merchant account, and some fields may be missing for some accounts. See the schema for details.
using Boltpay.SDK;
using Boltpay.SDK.Models.Requests;
using Boltpay.SDK.Models.Components;
var sdk = new BoltSDK(security: new Security() {
Oauth = "<YOUR_OAUTH_HERE>",
ApiKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Account.GetDetailsAsync(
xPublishableKey: "<value>",
xMerchantClientId: "<id>"
);
// handle response
Parameter |
Type |
Required |
Description |
XPublishableKey |
string |
✔️ |
The publicly shareable identifier used to identify your Bolt merchant division. |
XMerchantClientId |
string |
➖ |
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. |
AccountGetResponse
Error Type |
Status Code |
Content Type |
Boltpay.SDK.Models.Errors.Error |
4XX |
application/json |
Boltpay.SDK.Models.Errors.FieldError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.SDKException |
5XX |
*/* |
Add an address to the shopper's account
using Boltpay.SDK;
using Boltpay.SDK.Models.Requests;
using Boltpay.SDK.Models.Components;
var sdk = new BoltSDK(security: new Security() {
Oauth = "<YOUR_OAUTH_HERE>",
ApiKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Account.AddAddressAsync(
xPublishableKey: "<value>",
addressListing: new AddressListingInput() {
FirstName = "Alice",
LastName = "Baker",
Company = "ACME Corporation",
StreetAddress1 = "535 Mission St, Ste 1401",
StreetAddress2 = "c/o Shipping Department",
Locality = "San Francisco",
PostalCode = "94105",
Region = "CA",
CountryCode = Boltpay.SDK.Models.Components.CountryCode.Us,
Email = "[email protected]",
Phone = "+14155550199",
},
xMerchantClientId: "<id>"
);
// handle response
Parameter |
Type |
Required |
Description |
XPublishableKey |
string |
✔️ |
The publicly shareable identifier used to identify your Bolt merchant division. |
AddressListing |
AddressListingInput |
✔️ |
N/A |
XMerchantClientId |
string |
➖ |
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. |
AccountAddressCreateResponse
Error Type |
Status Code |
Content Type |
Boltpay.SDK.Models.Errors.Error |
4XX |
application/json |
Boltpay.SDK.Models.Errors.FieldError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.SDKException |
5XX |
*/* |
Edit an existing address on the shopper's account. This does not edit addresses that are already associated with other resources, such as transactions or shipments.
using Boltpay.SDK;
using Boltpay.SDK.Models.Requests;
using Boltpay.SDK.Models.Components;
var sdk = new BoltSDK(security: new Security() {
Oauth = "<YOUR_OAUTH_HERE>",
ApiKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Account.UpdateAddressAsync(
xPublishableKey: "<value>",
id: "D4g3h5tBuVYK9",
addressListing: new AddressListingInput() {
FirstName = "Alice",
LastName = "Baker",
Company = "ACME Corporation",
StreetAddress1 = "535 Mission St, Ste 1401",
StreetAddress2 = "c/o Shipping Department",
Locality = "San Francisco",
PostalCode = "94105",
Region = "CA",
CountryCode = Boltpay.SDK.Models.Components.CountryCode.Us,
Email = "[email protected]",
Phone = "+14155550199",
},
xMerchantClientId: "<id>"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
XPublishableKey |
string |
✔️ |
The publicly shareable identifier used to identify your Bolt merchant division. |
|
Id |
string |
✔️ |
The ID of the address to edit |
D4g3h5tBuVYK9 |
AddressListing |
AddressListingInput |
✔️ |
N/A |
|
XMerchantClientId |
string |
➖ |
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. |
|
AccountAddressEditResponse
Error Type |
Status Code |
Content Type |
Boltpay.SDK.Models.Errors.Error |
4XX |
application/json |
Boltpay.SDK.Models.Errors.FieldError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.SDKException |
5XX |
*/* |
Delete an existing address. Deleting an address does not invalidate or remove the address from transactions or shipments that are associated with it.
using Boltpay.SDK;
using Boltpay.SDK.Models.Requests;
using Boltpay.SDK.Models.Components;
var sdk = new BoltSDK(security: new Security() {
Oauth = "<YOUR_OAUTH_HERE>",
ApiKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Account.DeleteAddressAsync(
xPublishableKey: "<value>",
id: "D4g3h5tBuVYK9",
xMerchantClientId: "<id>"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
XPublishableKey |
string |
✔️ |
The publicly shareable identifier used to identify your Bolt merchant division. |
|
Id |
string |
✔️ |
The ID of the address to delete |
D4g3h5tBuVYK9 |
XMerchantClientId |
string |
➖ |
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. |
|
AccountAddressDeleteResponse
Error Type |
Status Code |
Content Type |
Boltpay.SDK.Models.Errors.Error |
4XX |
application/json |
Boltpay.SDK.Models.Errors.FieldError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.SDKException |
5XX |
*/* |
Add a payment method to a shopper's Bolt Account Wallet. For security purposes, this request must come from your backend.
Note: Before using this API, the credit card details must be tokenized by Bolt's credit card tokenization service. Please review our Bolt Payment Field Component or Install the Bolt Tokenizer documentation.
using Boltpay.SDK;
using Boltpay.SDK.Models.Requests;
using Boltpay.SDK.Models.Components;
var sdk = new BoltSDK(security: new Security() {
Oauth = "<YOUR_OAUTH_HERE>",
ApiKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Account.AddPaymentMethodAsync(
xPublishableKey: "<value>",
paymentMethod: PaymentMethodInput.CreatePaymentMethodAffirm(
new PaymentMethodAffirm() {
DotTag = Boltpay.SDK.Models.Components.PaymentMethodAffirmTag.Affirm,
ReturnUrl = "www.example.com/handle_affirm_success",
}
),
xMerchantClientId: "<id>"
);
// handle response
Parameter |
Type |
Required |
Description |
XPublishableKey |
string |
✔️ |
The publicly shareable identifier used to identify your Bolt merchant division. |
PaymentMethod |
PaymentMethodInput |
✔️ |
N/A |
XMerchantClientId |
string |
➖ |
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. |
AccountAddPaymentMethodResponse
Error Type |
Status Code |
Content Type |
Boltpay.SDK.Models.Errors.Error |
4XX |
application/json |
Boltpay.SDK.Models.Errors.FieldError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.CreditCardError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.SDKException |
5XX |
*/* |
Delete an existing payment method. Deleting a payment method does not invalidate or remove it from transactions or orders that are associated with it.
using Boltpay.SDK;
using Boltpay.SDK.Models.Requests;
using Boltpay.SDK.Models.Components;
var sdk = new BoltSDK(security: new Security() {
Oauth = "<YOUR_OAUTH_HERE>",
ApiKey = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Account.DeletePaymentMethodAsync(
xPublishableKey: "<value>",
id: "D4g3h5tBuVYK9",
xMerchantClientId: "<id>"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
XPublishableKey |
string |
✔️ |
The publicly shareable identifier used to identify your Bolt merchant division. |
|
Id |
string |
✔️ |
The ID of the payment method to delete |
D4g3h5tBuVYK9 |
XMerchantClientId |
string |
➖ |
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics. |
|
AccountPaymentMethodDeleteResponse
Error Type |
Status Code |
Content Type |
Boltpay.SDK.Models.Errors.Error |
4XX |
application/json |
Boltpay.SDK.Models.Errors.FieldError |
4XX |
application/json |
Boltpay.SDK.Models.Errors.SDKException |
5XX |
*/* |