Apply a gift card to a checkout (Storefront)
Applies a gift card to the checkout as a tender, not a discount: the order total and the tax do not change. The answer carries providerAmountDue, what the payment provider will be charged, kept apart from discountAmount so a storefront does not show stored value as a price cut. Limited to 5 requests per minute per IP.
For /api/vc/{connectionId}/* routes the connectionId (vc_*) is in the URL path — not a header. Live-mode requests must also send a matching Origin header.
In: header
Path Parameters
Sales channel ID (vc_*), the canonical salesChannelId. connectionId is the deprecated name of the same value and is still the literal path segment.
Checkout id, returned by checkout (create checkout).
Header Parameters
Origin of the storefront page making the call, for example https://shop.example.com. Required: a request with no Origin header is refused with 403. On a LIVE channel its host must equal the channel's registered domain (or one of its subdomains) or match an allowed origin. A TEST channel with no domain accepts any origin; once a domain is set it is matched as on LIVE.
Version of the calling SDK (the Brainerce SDK sends it automatically). Informational: it is recorded on the channel and never changes the response.
The gift card code as the shopper typed it. Case, spaces and dashes are all tolerated, and characters excluded from the code alphabet (I, L, O, U) are corrected to the ones they are mistaken for.
4 <= length <= 64curl -X POST "https://api.brainerce.com/api/vc/string/checkout/string/gift-card" \ -H "origin: string" \ -H "X-SDK-Version: string" \ -H "Content-Type: application/json" \ -d '{ "code": "A1B2-C3D4-E5F6-G7H8-J9K0" }'{
"tenderId": "cltnd_abc123",
"amountApplied": "25.00",
"providerAmountDue": "21.96"
}{
"statusCode": 400,
"code": "VALIDATION_FAILED",
"message": "name should not be empty, price must be a positive number",
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/checkout/{checkoutId}/gift-card"
}{
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "API key does not have the required scope: products:write",
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/checkout/{checkoutId}/gift-card"
}{
"statusCode": 404,
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found",
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/checkout/{checkoutId}/gift-card"
}{
"statusCode": 429,
"code": "RATE_LIMITED",
"message": "Too many requests",
"details": {
"retryAfterSeconds": 12
},
"timestamp": "2026-08-23T10:15:00.000Z",
"path": "/api/vc/{connectionId}/checkout/{checkoutId}/gift-card"
}