payment Terms Deletemutation
mutation
2024-07
Requires write
access scope. Also: User must have either orders or draft orders access according to the reference.
Delete payment terms for an order. To delete payment terms on a draft order, use a draft order mutation and include the request with the Draft
.
Arguments
The input fields used to delete the payment terms.
Was this section helpful?
PaymentTermsDeletePayload returns
The deleted payment terms ID.
The list of errors that occurred from executing the mutation.
Was this section helpful?
Code examples for MUTATION: paymentTermsDelete
Query Reference for MUTATION: paymentTermsDelete
"mutation paymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: paymentTermsDelete
"{\n \"input\": {\n \"paymentTermsId\": \"gid://shopify/<objectName>/10079785100\"\n }\n}"
Schema Reference for MUTATION: paymentTermsDelete
"input PaymentTermsDeleteInput {\n paymentTermsId: ID!\n}\n"
Display Examples for MUTATION: paymentTermsDelete
[ { "example": { "type_name": "paymenttermsdelete", "title": "Delete payment terms", "description": "Delete payment terms for an order.", "query_string": "mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n}", "variables": { "input": { "paymentTermsId": "gid://shopify/PaymentTerms/977822362" } }, "response": { "data": { "paymentTermsDelete": { "deletedId": "gid://shopify/PaymentTerms/977822362", "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/payments/payment_flexibility/test/unit/graph_api/admin/mutations/payment_terms_delete_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-07/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) { paymentTermsDelete(input: $input) { deletedId userErrors { field message } } }\",\n \"variables\": {\n \"input\": {\n \"paymentTermsId\": \"gid://shopify/PaymentTerms/977822362\"\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"paymentTermsId\": \"gid://shopify/PaymentTerms/977822362\"\n }\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"paymentTermsId\": \"gid://shopify/PaymentTerms/977822362\"\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"paymentTermsId\": \"gid://shopify/PaymentTerms/977822362\"\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"paymentTermsId\" => \"gid://shopify/PaymentTerms/977822362\",\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The input fields used to delete the payment terms.", "type": { "kind": "INPUT_OBJECT", "name": "PaymentTermsDeleteInput", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "PaymentTermsDeleteInput!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " {\"paymentTermsId\":\"gid://shopify/PaymentTerms/977822362\"}", "typeKind": "MUTATION" } ] } ]