post__credits_packs_buy
TypeScript Client Library
public buyCreditsPack = async (body: BuyCreditsPackRequest): Promise<BuyCreditsPackResponse> => {
return this.makeRequest<BuyCreditsPackResponse>('credits/packs/buy', 'POST', body);
};Code Samples
curl -X POST https://backend.flashback.tech/credits/packs/buy \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d '{"packId": "pack-1"}'POST https://backend.flashback.tech/credits/packs/buy HTTP/1.1
Host: backend.flashback.tech
Accept: application/json
Content-Type: application/json
Authorization: Bearer {access-token}
{"packId": "pack-1"}const headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
};
const body = { packId: 'pack-1' };
fetch('https://backend.flashback.tech/credits/packs/buy', {
method: 'POST',
headers,
body: JSON.stringify(body)
})
.then(res => res.json())
.then(data => {
if (data.success && data.checkoutUrl) window.location.href = data.checkoutUrl;
});{
"success": true,
"checkoutUrl": "https://checkout.stripe.com/c/pay/cs_xxx",
"sessionId": "cs_xxx"
}Request Body
Name
Type
Required
Description
Responses
Status
Meaning
Description
Schema
Response Schema (200)
Name
Type
Required
Description
Security
Notes
Last updated
Was this helpful?