Gateways
15 endpoints. Each needs an API key or OAuth token with the scope shown; the key already names its store, so paths start at /v1/store. Generated from the live contract; also in openapi.json.
Seller's own connected gateways
/v1/store/gatewaysOr name the store: GET /v1/stores/{storeId}/gateways
Response ListGatewaysResponse
connectionsGatewayConnection[]requiredavailablePlatformGateway[]required
Example
curl "https://api.shopfa.st/v1/store/gateways" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/gateways",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/gateways", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Connect an own gateway (sandbox connects instantly; real providers return an onboarding URL). Calling it again resumes onboarding or picks up a finished one. Provider shopfast_pay sets up the account ShopFast pays merchant-of-record payouts to. A store set to ShopFast Pay that ShopFast Pay cannot serve moves to its own gateways once the connection can take payments.
/v1/store/gatewaysOr name the store: POST /v1/stores/{storeId}/gateways
Body
provider"shopfast_pay" | "sandbox" | "stripe" | "paypal" | "btcpay" | "manual" | "plugin" | "crypto_direct" | "stripe_keys" | "paypal_keys" | "square" | "mollie" | "razorpay" | "paystack" | "nowpayments" | "cryptomus" | "paypal_email" | "shopify" | "paddle" | "heleket" | "sumup" | "authorize_net" | "nmi" | "skinloop" | "cashapp" | "paypal_ff" | "gift_codes"required
Response ConnectGatewayResponse
connectionGatewayConnectionrequiredpaymentModelPaymentModel | nullrequiredswitchedToOwnbooleanrequiredonboardingUrlstringrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "shopfast_pay"
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"provider": "shopfast_pay"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"provider": "shopfast_pay"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways", strings.NewReader(`{
"provider": "shopfast_pay"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Manual payment methods (own gateway stores)
/v1/store/gateways/manualOr name the store: GET /v1/stores/{storeId}/gateways/manual
Response ListManualMethodsResponse
itemsManualPaymentMethod[]required
Example
curl "https://api.shopfa.st/v1/store/gateways/manual" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways/manual', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/gateways/manual",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/gateways/manual", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Add a manual payment method (an enabled one moves a store ShopFast Pay cannot serve to its own gateways)
/v1/store/gateways/manualOr name the store: POST /v1/stores/{storeId}/gateways/manual
Body
namestringrequiredinstructionsstringrequiredenabledbooleanrequiredpayWithinHoursinteger
Response CreateManualMethodResponse
idManualMethodIdrequirednamestringrequiredinstructionsstringrequiredenabledbooleanrequiredpayWithinHoursintegerrequiredpositionintegerrequiredawaitingintegerrequiredcreatedAtTimestamprequiredpaymentModelPaymentModel | nullrequiredswitchedToOwnbooleanrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways/manual" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"instructions": "string",
"enabled": false,
"payWithinHours": 72
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/manual', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"instructions": "string",
"enabled": false,
"payWithinHours": 72
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways/manual",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"name": "string",
"instructions": "string",
"enabled": False,
"payWithinHours": 72
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways/manual", strings.NewReader(`{
"name": "string",
"instructions": "string",
"enabled": false,
"payWithinHours": 72
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Change a manual payment method
/v1/store/gateways/manual/{methodId}Or name the store: PUT /v1/stores/{storeId}/gateways/manual/{methodId}
Parameters
methodIdmpm_…pathrequired
Body
namestringrequiredinstructionsstringrequiredenabledbooleanrequiredpayWithinHoursinteger
Response UpdateManualMethodResponse
idManualMethodIdrequirednamestringrequiredinstructionsstringrequiredenabledbooleanrequiredpayWithinHoursintegerrequiredpositionintegerrequiredawaitingintegerrequiredcreatedAtTimestamprequiredpaymentModelPaymentModel | nullrequiredswitchedToOwnbooleanrequired
Example
curl -X PUT "https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"instructions": "string",
"enabled": false,
"payWithinHours": 72
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"instructions": "string",
"enabled": false,
"payWithinHours": 72
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"PUT",
"https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"name": "string",
"instructions": "string",
"enabled": False,
"payWithinHours": 72
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk", strings.NewReader(`{
"name": "string",
"instructions": "string",
"enabled": false,
"payWithinHours": 72
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Remove a manual payment method (checkouts already waiting keep their instructions)
/v1/store/gateways/manual/{methodId}Or name the store: DELETE /v1/stores/{storeId}/gateways/manual/{methodId}
Parameters
methodIdmpm_…pathrequired
Response Ok
okbooleanrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"DELETE",
"https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("DELETE", "https://api.shopfa.st/v1/store/gateways/manual/mpm_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Connect the seller's BTCPay Server store: checks the key and registers ShopFast's webhook
/v1/store/gateways/btcpayOr name the store: POST /v1/stores/{storeId}/gateways/btcpay
Body
serverUrlstringrequiredbtcpayStoreIdstringrequiredapiKeystringrequired
Response GatewayConnected
connectionGatewayConnectionrequiredpaymentModelPaymentModel | nullrequiredswitchedToOwnbooleanrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways/btcpay" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"serverUrl": "string",
"btcpayStoreId": "string",
"apiKey": "string"
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/btcpay', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"serverUrl": "string",
"btcpayStoreId": "string",
"apiKey": "string"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways/btcpay",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"serverUrl": "string",
"btcpayStoreId": "string",
"apiKey": "string"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways/btcpay", strings.NewReader(`{
"serverUrl": "string",
"btcpayStoreId": "string",
"apiKey": "string"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Connect a gateway with the seller's own API keys: checks them with the provider, sets up payment events and seals them. A store set to ShopFast Pay that ShopFast Pay cannot serve moves to its own gateways
/v1/store/gateways/{provider}/keysOr name the store: POST /v1/stores/{storeId}/gateways/{provider}/keys
Parameters
provider"stripe_keys" | "paypal_keys" | "square" | "mollie" | "razorpay" | "paystack" | "nowpayments" | "cryptomus" | "paypal_email" | "shopify" | "paddle" | "heleket" | "sumup" | "authorize_net" | "nmi" | "skinloop" | "cashapp" | "paypal_ff" | "gift_codes"pathrequired
Body
keysobjectrequired
Response GatewayConnected
connectionGatewayConnectionrequiredpaymentModelPaymentModel | nullrequiredswitchedToOwnbooleanrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways/stripe_keys/keys" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"keys": {}
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/stripe_keys/keys', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"keys": {}
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways/stripe_keys/keys",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"keys": {}
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways/stripe_keys/keys", strings.NewReader(`{
"keys": {}
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Change a connected gateway's optional settings without reconnecting (Stripe: the publishable key and the payment method configuration): checked with the provider, sealed with the keys
/v1/store/gateways/{provider}/settingsOr name the store: POST /v1/stores/{storeId}/gateways/{provider}/settings
Parameters
provider"stripe_keys" | "paypal_keys" | "square" | "mollie" | "razorpay" | "paystack" | "nowpayments" | "cryptomus" | "paypal_email" | "shopify" | "paddle" | "heleket" | "sumup" | "authorize_net" | "nmi" | "skinloop" | "cashapp" | "paypal_ff" | "gift_codes"pathrequired
Body
settingsobjectrequired
Response KeyedPayOptions
optionsstring[]requiredatCheckoutstring[]requiredreadAtTimestamp | nullrequirednotestringrequiredinPagebooleanrequiredpaymentMethodConfigstringrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways/stripe_keys/settings" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"settings": {}
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/stripe_keys/settings', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"settings": {}
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways/stripe_keys/settings",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"settings": {}
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways/stripe_keys/settings", strings.NewReader(`{
"settings": {}
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Read the ways to pay the seller turned on at the provider again (Stripe's payment method configuration) and offer them at checkout
/v1/store/gateways/{provider}/options/refreshOr name the store: POST /v1/stores/{storeId}/gateways/{provider}/options/refresh
Parameters
provider"stripe_keys" | "paypal_keys" | "square" | "mollie" | "razorpay" | "paystack" | "nowpayments" | "cryptomus" | "paypal_email" | "shopify" | "paddle" | "heleket" | "sumup" | "authorize_net" | "nmi" | "skinloop" | "cashapp" | "paypal_ff" | "gift_codes"pathrequired
Response KeyedPayOptions
optionsstring[]requiredatCheckoutstring[]requiredreadAtTimestamp | nullrequirednotestringrequiredinPagebooleanrequiredpaymentMethodConfigstringrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways/stripe_keys/options/refresh" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways/stripe_keys/options/refresh', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways/stripe_keys/options/refresh",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways/stripe_keys/options/refresh", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Shopify's page where the seller approves their own app (after connecting its keys). Its state works 15 minutes, for this store and member
/v1/store/gateways/shopify/authorizeOr name the store: GET /v1/stores/{storeId}/gateways/shopify/authorize
Response ShopifyAuthorizeUrlResponse
urlstringrequired
Example
curl "https://api.shopfa.st/v1/store/gateways/shopify/authorize" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways/shopify/authorize', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/gateways/shopify/authorize",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/gateways/shopify/authorize", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Finish connecting Shopify with the query Shopify sent to /settings/payments/shopify: checks it, takes the app's token and adds ShopFast's webhooks
/v1/store/gateways/shopify/callbackOr name the store: POST /v1/stores/{storeId}/gateways/shopify/callback
Body
codestringrequiredhmacstringrequiredshopstringrequiredstatestringrequiredtimestampstringrequiredhoststring | null
Response GatewayConnected
connectionGatewayConnectionrequiredpaymentModelPaymentModel | nullrequiredswitchedToOwnbooleanrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/gateways/shopify/callback" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "string",
"hmac": "string",
"shop": "string",
"state": "string",
"timestamp": "string",
"host": null
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/shopify/callback', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": "string",
"hmac": "string",
"shop": "string",
"state": "string",
"timestamp": "string",
"host": null
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/gateways/shopify/callback",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"code": "string",
"hmac": "string",
"shop": "string",
"state": "string",
"timestamp": "string",
"host": None
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/gateways/shopify/callback", strings.NewReader(`{
"code": "string",
"hmac": "string",
"shop": "string",
"state": "string",
"timestamp": "string",
"host": null
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Disconnect a gateway: new checkouts stop using it; paid orders and refunds keep working where the provider allows
/v1/store/gateways/{provider}Or name the store: DELETE /v1/stores/{storeId}/gateways/{provider}
Parameters
provider"shopfast_pay" | "sandbox" | "stripe" | "paypal" | "btcpay" | "manual" | "plugin" | "crypto_direct" | "stripe_keys" | "paypal_keys" | "square" | "mollie" | "razorpay" | "paystack" | "nowpayments" | "cryptomus" | "paypal_email" | "shopify" | "paddle" | "heleket" | "sumup" | "authorize_net" | "nmi" | "skinloop" | "cashapp" | "paypal_ff" | "gift_codes"pathrequired
Response DisconnectGatewayResponse
connectionGatewayConnectionrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/gateways/shopfast_pay" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways/shopfast_pay', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"DELETE",
"https://api.shopfa.st/v1/store/gateways/shopfast_pay",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("DELETE", "https://api.shopfa.st/v1/store/gateways/shopfast_pay", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Gift cards: the cards the store takes (the defaults until the first save) and how many codes wait for review
/v1/store/gateways/gift-codesOr name the store: GET /v1/stores/{storeId}/gateways/gift-codes
Response GiftCodeSettingsView
settingsGiftCodeSettingsrequiredconnectedbooleanrequiredsavedbooleanrequiredpendingintegerrequiredstoreCurrencyCurrencyCoderequired
Example
curl "https://api.shopfa.st/v1/store/gateways/gift-codes" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/gateways/gift-codes', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/gateways/gift-codes",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/gateways/gift-codes", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Gift cards: save the cards, their values, pictures and Eneba and G2A links (links are checked)
/v1/store/gateways/gift-codesOr name the store: PUT /v1/stores/{storeId}/gateways/gift-codes
Body
typesobject[]requiredidstringrequiredpreset"binance" | "steam" | "custom"requiredenabledbooleanrequirednamestringrequiredimageobject | nullcurrenciesobject[]requiredcurrency"USD" | "EUR" | "GBP" | "CAD" | "AUD" | "INR" | "NPR" | "JPY"requiredunitstringrequiredfacesobject[]required
linksobjectenebastringg2astring
instructionsstring
change"store_credit" | "none"reviewHoursinteger
Response GiftCodeSettingsView
settingsGiftCodeSettingsrequiredconnectedbooleanrequiredsavedbooleanrequiredpendingintegerrequiredstoreCurrencyCurrencyCoderequired
Example
curl -X PUT "https://api.shopfa.st/v1/store/gateways/gift-codes" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"types": [
{
"id": "string",
"preset": "binance",
"enabled": false,
"name": "string",
"currencies": [
{
"currency": "USD",
"unit": "string",
"faces": [
{
"valueMinor": null
}
]
}
]
}
],
"change": "store_credit",
"reviewHours": 48
}'const res = await fetch('https://api.shopfa.st/v1/store/gateways/gift-codes', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"types": [
{
"id": "string",
"preset": "binance",
"enabled": false,
"name": "string",
"currencies": [
{
"currency": "USD",
"unit": "string",
"faces": [
{
"valueMinor": null
}
]
}
]
}
],
"change": "store_credit",
"reviewHours": 48
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"PUT",
"https://api.shopfa.st/v1/store/gateways/gift-codes",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"types": [
{
"id": "string",
"preset": "binance",
"enabled": False,
"name": "string",
"currencies": [
{
"currency": "USD",
"unit": "string",
"faces": [
{
"valueMinor": None
}
]
}
]
}
],
"change": "store_credit",
"reviewHours": 48
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/gateways/gift-codes", strings.NewReader(`{
"types": [
{
"id": "string",
"preset": "binance",
"enabled": false,
"name": "string",
"currencies": [
{
"currency": "USD",
"unit": "string",
"faces": [
{
"valueMinor": null
}
]
}
]
}
],
"change": "store_credit",
"reviewHours": 48
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)