tanqoryExtCheckoutPaypalExpress
- Query
- Storefront
What the checkout loads PayPal's button with: the store's active PayPal gateway account offers paypal for this cart (its client id, never a secret), the cart's currency and the intent the store's capture method gives. Null when PayPal is not offered for the cart (no account, a currency PayPal does not take, an empty cart, nothing to pay).
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
cartId | ID! | Required |
Returns
| Field | Type | Description |
|---|---|---|
clientId | String! | The store's PayPal REST app client id (public), for the SDK's |
currencyCode | CurrencyCode! | The cart's currency, for the SDK's |
intent | TanqoryExtPaypalIntent! | CAPTURE, or AUTHORIZE when the store's capture method does not capture at checkout; the SDK's |
optionId | ID! | The PayPal gateway option of tanqoryExtCheckoutPaymentOptions this button pays with. |
Example request
A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.
Set STORE_ID and TANQORY_STOREFRONT_TOKEN in your environment first (Make your first API call).
curl -X POST "https://$STORE_HOST/api/v1/stores/$STORE_ID/2026-10/graphql" \
-H "X-Tanqory-Storefront-Access-Token: $TANQORY_STOREFRONT_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"query TanqoryExtCheckoutPaypalExpress($cartId: ID!) {\n tanqoryExtCheckoutPaypalExpress(cartId: $cartId) {\n clientId\n currencyCode\n intent\n optionId\n }\n}","variables":{"cartId":"gid://tanqory/Type/id"}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtCheckoutPaypalExpress(\$cartId: ID!) {
tanqoryExtCheckoutPaypalExpress(cartId: \$cartId) {
clientId
currencyCode
intent
optionId
}
}`;
const variables = {
"cartId": "gid://tanqory/Type/id"
};
const res = await fetch(`https://${process.env.STORE_HOST}/api/v1/stores/${process.env.STORE_ID}/2026-10/graphql`, {
method: 'POST',
headers: {
'X-Tanqory-Storefront-Access-Token': process.env.TANQORY_STOREFRONT_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({ query, variables }),
});
console.log(res.status, JSON.stringify(await res.json(), null, 2));# Python 3, standard library only. Save as request.py and run: python3 request.py
import json, os, urllib.request
query = """query TanqoryExtCheckoutPaypalExpress($cartId: ID!) {
tanqoryExtCheckoutPaypalExpress(cartId: $cartId) {
clientId
currencyCode
intent
optionId
}
}"""
variables = json.loads("""{
"cartId": "gid://tanqory/Type/id"
}""")
req = urllib.request.Request(
"https://" + os.environ["STORE_HOST"] + "/api/v1/stores/" + os.environ["STORE_ID"] + "/2026-10/graphql",
data=json.dumps({"query": query, "variables": variables}).encode(),
headers={
"X-Tanqory-Storefront-Access-Token": os.environ["TANQORY_STOREFRONT_TOKEN"],
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.status, json.dumps(json.load(res), indent=2))