Anchor to paymentTermsTemplatespayment
paymentTermsTemplates
query
The list of payment terms templates eligible for all shops and users.
Anchor to Arguments
Arguments
- Anchor to paymentTermsTypepayment•
Terms Type The payment terms type to filter the payment terms templates list.
Was this section helpful?
Anchor to Possible returnsPossible returns
- Anchor to PaymentTermsTemplatePayment•
Terms Template Represents the payment terms template object.
Was this section helpful?
Get the available payment terms templates
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
paymentTermsTemplates {
id
name
paymentTermsType
dueInDays
description
translatedName
}
}`,
);
const data = await response.json();
query {
paymentTermsTemplates {
id
name
paymentTermsType
dueInDays
description
translatedName
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2024-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query { paymentTermsTemplates { id name paymentTermsType dueInDays description translatedName } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query {
paymentTermsTemplates {
id
name
paymentTermsType
dueInDays
description
translatedName
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query {
paymentTermsTemplates {
id
name
paymentTermsType
dueInDays
description
translatedName
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query {
paymentTermsTemplates {
id
name
paymentTermsType
dueInDays
description
translatedName
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"paymentTermsTemplates": [
{
"id": "gid://shopify/PaymentTermsTemplate/1",
"name": "Due on receipt",
"paymentTermsType": "RECEIPT",
"dueInDays": null,
"description": "Due on receipt",
"translatedName": "Due on receipt"
},
{
"id": "gid://shopify/PaymentTermsTemplate/9",
"name": "Due on fulfillment",
"paymentTermsType": "FULFILLMENT",
"dueInDays": null,
"description": "Due on fulfillment",
"translatedName": "Due on fulfillment"
},
{
"id": "gid://shopify/PaymentTermsTemplate/2",
"name": "Net 7",
"paymentTermsType": "NET",
"dueInDays": 7,
"description": "Within 7 days",