CartsResource
carts.CartsResource
Properties
Methods
addShippingMethod
addShippingMethod(cart_id
, payload
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Adds a shipping method to cart
Parameters
cart_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
complete
complete(cart_id
, customHeaders?
): ResponsePromise
<StoreCompleteCartRes
>
Completes a cart. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header Idempotency-Key. If not provided, we will generate one for the request.
Parameters
cart_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCompleteCartRes
>
create
create(payload?
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Creates a cart
Parameters
payload
StorePostCartReqcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
createPaymentSessions
createPaymentSessions(cart_id
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Creates payment sessions. Initializes the payment sessions that can be used to pay for the items of the cart. This is usually called when a customer proceeds to checkout.
Parameters
cart_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
deleteDiscount
deleteDiscount(cart_id
, code
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Removes a discount from cart.
Parameters
cart_id
stringRequiredcode
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
deletePaymentSession
deletePaymentSession(cart_id
, provider_id
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Removes a payment session from a cart. Can be useful in case a payment has failed
Parameters
cart_id
stringRequiredprovider_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
refreshPaymentSession
refreshPaymentSession(cart_id
, provider_id
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Refreshes a payment session.
Parameters
cart_id
stringRequiredprovider_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
retrieve
retrieve(cart_id
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Retrieves a cart
Parameters
cart_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
setPaymentSession
setPaymentSession(cart_id
, payload
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Refreshes a payment session.
Parameters
cart_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
update
update(cart_id
, payload
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Updates a cart
Parameters
cart_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>
updatePaymentSession
updatePaymentSession(cart_id
, provider_id
, payload
, customHeaders?
): ResponsePromise
<StoreCartsRes
>
Updates the payment method
Parameters
cart_id
stringRequiredprovider_id
stringRequiredcustomHeaders
Record<string, any>RequiredDefault: `{}`
Returns
ResponsePromise
<StoreCartsRes
>