novinzodevelopers
RPCReferenceStore credit

StorefrontStoreCredit

POST/rpc#StorefrontStoreCredit

The store credit the signed-in shopper has at the store, and how they pay with it. Routed to the storefront RPC server by the x-storefront-request: true header. The store is resolved from the merchant domain's Host, so call it through the storefront route POST https://<store-domain>/api/store-credit, which forwards the shopper's cookies.

Header Parameters

x-storefront-request*"true"

Value in

  • "true"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

_tag*"Request"

Value in

  • "Request"
id*string

Correlates the response line with this request.

tag*"StorefrontStoreCredit"

Value in

  • "StorefrontStoreCredit"
payload*not (null)
headers*array<any>

Leave empty; the server prepends the HTTP request headers.

Itemsitems <= 0

Response Body

application/json

curl -X POST "https://$STORE_DOMAIN/api/store-credit" \  -H "Content-Type: application/json" \  -d 'null'
{  "_tag": "Exit",  "requestId": "string",  "exit": {    "_tag": "Success",    "value": {      "buyer": {        "email": "string",        "balance": {          "amountMinorUnits": "string",          "currency": "AED"        },        "method": {          "id": "string",          "providerId": "stripe",          "displayName": "string",          "iconUrl": "string",          "capabilities": {            "canCapture": true,            "canRefund": true,            "canPartialRefund": true,            "requiresManualVerification": true,            "notifications": [              "webhook"            ],            "supportsPreauthorization": true,            "hasApiValidation": true,            "redeemsVouchers": true          },          "renewals": "automatic",          "cryptoAssets": [            "btc"          ],          "publishableKey": "string"        }      }    }  }}