# paymentTermsDelete - admin-graphql - MUTATION Version: 2024-07 ## Description 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 `DraftOrderInput`. ### Access Scopes `write_payment_terms` access scope. Also: User must have either orders or draft orders access according to the reference. ## Arguments * [input](/docs/api/admin-graphql/2024-07/input-objects/PaymentTermsDeleteInput): PaymentTermsDeleteInput! - The input fields used to delete the payment terms. ## Returns * [deletedId](/docs/api/admin-graphql/2024-07/scalars/ID): ID The deleted payment terms ID. * [userErrors](/docs/api/admin-graphql/2024-07/objects/PaymentTermsDeleteUserError): PaymentTermsDeleteUserError! The list of errors that occurred from executing the mutation. ## Examples ### Delete payment terms 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" 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" 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" 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" Graphql query: "mutation PaymentTermsDelete($input: PaymentTermsDeleteInput!) {\n paymentTermsDelete(input: $input) {\n deletedId\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "input": { "paymentTermsId": "gid://shopify/PaymentTerms/977822362" } } #### Graphql Response { "data": { "paymentTermsDelete": { "deletedId": "gid://shopify/PaymentTerms/977822362", "userErrors": [] } } }