Thanks for being patient while we implement your feedback to improve the developer experience.

Add Store Credit

POST /checkouts/{checkoutId}/store-credit

Request

Applies any available store credit to a checkout. As on the storefront, all available store credit will be used (up to the value of the order) and no amount need be specified.

Note

  • Substitute your storefront domain for yourstore.example.com.
  • The Send a Test Request feature is not currently supported for this endpoint.

Parameters

  • store_domain in path - string
  • checkoutId in path - string - required

Response

Body

object | application/json
  • data
    object

example

{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "cart": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "customer_id": 0, "email": "string", "currency": { "name": "string", "code": "string", "symbol": "string", "decimalPlaces": 0 }, "istaxIncluded": true, "baseAmount": 0, "discountAmount": 0, "cartAmount": 0, "coupons": [ { "id": "string", "code": "string", "displayName": "string", "couponType": "string", "discountedAmount": 0 } ], "discounts": [ { "name": "string", "discountedAmount": 0 } ], "lineItems": [ { "physicalItems": [ { "id": "string", "parentId": "string", "variantId": 0, "productId": 0, "sku": "string", "name": "string", "url": "string", "quantity": 0, "isTaxable": true, "imageUrl": "string", "discounts": [ { "name": "string", "discountedAmount": 0 } ], "discountAmount": 0, "couponAmount": 0, "listPrice": 0, "salePrice": 0, "extendedListPrice": 0, "extendedSalePrice": 0, "type": "string", "addedByPromotion": true, "isShippingRequired": true, "isMutable": true, "giftWrapping": { "name": "string", "message": "string", "amount": 0 } } ], "digitalItems": [ { "id": "string", "parentId": "string", "variantId": 0, "productId": 0, "sku": "string", "name": "string", "url": "string", "quantity": 0, "brand": "string", "isTaxable": true, "imageUrl": "string", "discounts": [ { "name": "string", "discountedAmount": 0 } ], "discountAmount": 0, "couponAmount": 0, "listPrice": 0, "salePrice": 0, "extendedListPrice": 0, "extendedSalePrice": 0, "type": "string", "isMutable": true, "isShippingRequired": true, "downloadFileUrls": [ "string" ], "downloadPageUrl": "string", "downloadSize": "string" } ], "giftCertificate": [ { "id": "string", "name": "string", "theme": "string", "amount": 0, "taxable": true, "sender": { "name": "string", "email": "string" }, "recipient": { "name": "string", "email": "string" }, "message": "string", "type": "string" } ], "customItems": [ { "id": "string", "sku": "string", "name": "string", "quantity": "string", "listPrice": "string" } ] } ], "createdTime": "string", "updatedTime": "string" }, "billingAddress": { "firstName": "string", "lastName": "string", "email": "string", "company": "string", "address1": "string", "address2": "string", "city": "string", "stateOrProvince": "string", "stateOrProvinceCode": "string", "countryCode": "string", "postalCode": "string", "phone": "string", "customFields": [ { "fieldId": "string", "fieldValue": "string" } ], "id": "string" }, "consignments": [ { "id": "string", "shippingAddress": {}, "address": { "firstName": "string", "lastName": "string", "email": "string", "company": "string", "address1": "string", "address2": "string", "city": "string", "stateOrProvince": "string", "stateOrProvinceCode": "string", "countryCode": "string", "postalCode": "string", "phone": "string", "customFields": [ { "fieldId": "string", "fieldValue": "string" } ], "id": "string" }, "availableShippingOptions": [ { "id": "string", "type": "string", "imageUrl": "string", "cost": 0, "transitTime": "string", "isRecommended": true } ], "selectedShippingOption": { "id": "string", "type": "string", "imageUrl": "string", "cost": 0, "transitTime": "string" }, "couponDiscounts": [ { "code": "string", "amount": 0 } ], "discounts": [ { "id": "string" } ], "shippingCost": 0, "handlingCost": 0, "lineItemIds": [ "string" ] } ], "coupons": [ { "id": 0, "code": "string", "displayName": "string", "couponType": 0, "discountedAmount": 0 } ], "orderId": "string", "shippingCostTotal": 0, "giftWrappingCostTotal": 0, "handlingCostTotal": 0, "taxTotal": 0, "taxes": [ { "name": "Texas Taxes", "amount": 1.12 } ], "subtotal": 0, "grandTotal": 0, "giftCertificates": [ { "balance": 0, "code": "string", "purchaseDate": "2019-08-24", "remaining": 0, "used": 0 } ], "createdTime": "string", "updatedTime": "string", "customerMessage": "string", "outstandingBalance": 0, "isStoreCreditApplied": true } }

Remove Store Credit

DELETE /checkouts/{checkoutId}/store-credit

Request

Removes store credit from a checkout.

Note

  • Substitute your storefront domain for yourstore.example.com.
  • The Send a Test Request feature is not currently supported for this endpoint.

Parameters

  • store_domain in path - string
  • checkoutId in path - string - required

example

const options = {method: 'DELETE', headers: {'Content-Type': 'application/json'}}; fetch('https://yourstore.example.com/api/storefront/checkouts/[checkoutId]/store-credit', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));

Response

Body

object | application/json

    example

    {}