CheckoutClient#checkoutAsGuest(cartId, emailAddress, options);
The following operations are used to build up the various pieces of a cart checkout and handle checkout submission requests.
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
The guest’s contact information to add to the cart. |
|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a GuestTokenResponse.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a GuestTokenResponse.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
|
✅ |
The guest checkout token to validate. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a GuestTokenValidationResponse.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
✅ |
The contact information to add to the cart. |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Cart.
Note
|
Use getPricedFulfillmentOptionsForCart instead if using Fulfillment Services. |
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
|
✅ |
The id of the fulfillment group to retrieve fulfillment options for. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns an array of FulfillmentOptionPricedResponse.
Note
|
Since 1.5.3 (Release Train 1.8.2) |
Retrieve available priced fulfillment options for the cart
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
Returns a FulfillmentOptionResponse.
CheckoutClient#updateFulfillmentGroupInCart(cartId, referenceNumber, fulfillmentGroupRequest, options);
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
|
✅ |
The id of the fulfillment group to update. |
|
✅ |
The updated fulfillment option information for the fulfillment group. |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Cart.
const fulfillmentGroupRequest: UpdateFulfillmentGroupRequest = {
type: 'SHIP',
fulfillmentOption: {
name: 'Ship to Home',
useFlatRates: true,
taxCode: 'us',
taxable: true
},
address: {
addressLine1: '123 Street'
}
};
const cart = await checkoutClient.updateFulfillmentGroupInCart(
'CART_ID',
'FULFILLMENT_GROUP_ID',
fulfillmentGroupRequest,
{ accessToken }
);
console.log(cart);
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns an array of PaymentMethodOptionResponse.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
✅ |
The payment information to add to the cart. |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Cart.
const payment: PaymentRequest = {
savedPaymentMethodId: '1',
type: 'CREDIT_CARD',
gatewayType: 'PASS_THROUGH',
amount: { amount: 100, currency: 'USD' },
billingAddress: {
addressLine1: '123 Street'
},
shouldSavePaymentForFutureUse: false,
paymentMethodProperties: {}
};
const cart = await checkoutClient.addPaymentToCart('CART_ID', payment, { accessToken });
console.log(cart);
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
|
✅ |
The id of the payment to update. |
|
✅ |
The payment information to add to the cart. |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Cart.
const payment: PaymentRequest = {
savedPaymentMethodId: '1',
type: 'CREDIT_CARD',
gatewayType: 'PASS_THROUGH',
amount: { amount: 100, currency: 'USD' },
billingAddress: {
addressLine1: '123 Street'
},
shouldSavePaymentForFutureUse: false,
paymentMethodProperties: {}
};
const cart = await checkoutClient.addPaymentToCart('CART_ID', 'PAYMENT_ID', payment, { accessToken });
console.log(cart);
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
|
✅ |
The id of the payment to remove. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Cart.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a Cart.
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
Request DTO used for providing information for the cart approval flows, such as submitting cart for approval or rejecting cart. |
|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a CartApprovalProcessResponse if successful. If the request fails, a CartApprovalValidationApiError is thrown.
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
Request DTO used for providing information for the cart approval flows, such as submitting cart for approval or rejecting cart. |
|
|
|
✅ |
The id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a CartApprovalProcessResponse if successful. If the request fails, a CartApprovalValidationApiError is thrown.
Parameter | Type | Required? | Description |
---|---|---|---|
|
|
✅ |
The id of the cart. |
|
|
✅ |
The request id of the cart. |
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a CheckoutResponse.