Skip to content

Latest commit

 

History

History
315 lines (233 loc) · 51.3 KB

README.md

File metadata and controls

315 lines (233 loc) · 51.3 KB

Account

(Account)

Overview

Use the Accounts API to access shoppers' accounts to empower your checkout and facilitate shoppers' choices.

Available Operations

GetDetails

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.

Example Usage

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

Parameters

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.

Response

AccountGetResponse

Errors

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 */*

AddAddress

Add an address to the shopper's account

Example Usage

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

Parameters

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.

Response

AccountAddressCreateResponse

Errors

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 */*

UpdateAddress

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.

Example Usage

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

Parameters

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.

Response

AccountAddressEditResponse

Errors

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 */*

DeleteAddress

Delete an existing address. Deleting an address does not invalidate or remove the address from transactions or shipments that are associated with it.

Example Usage

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

Parameters

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.

Response

AccountAddressDeleteResponse

Errors

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 */*

AddPaymentMethod

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.

Example Usage

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

Parameters

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.

Response

AccountAddPaymentMethodResponse

Errors

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 */*

DeletePaymentMethod

Delete an existing payment method. Deleting a payment method does not invalidate or remove it from transactions or orders that are associated with it.

Example Usage

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

Parameters

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.

Response

AccountPaymentMethodDeleteResponse

Errors

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 */*