How to require a deposit for payment terms on a Draft Order?

Hi,
We are facing an issue when creating a draft order with a paymentTemplateId. When we set up a payment term with a 15% deposit and enable the “require” option, the invoice URL does not appear when creating the draft order. Does anyone know how to assign a deposit to a draft order? [my store plan_name: partner_test]

1 Like

Hi,

We might need a bit more detail on this to troubleshoot. Is this a mutation you’re making? Can you post the full mutation and any userErrors that are being returned?

@Liam-Shopify, I perform the following mutation.
Mutation

mutation draftOrderCreate($input: DraftOrderInput!) {
  draftOrderCreate(input: $input) {
    draftOrder {
      id
      invoiceUrl
    }
    userErrors {
      field
      message
    }
  }
}

Body:

input: {
  lineItems: [
    {
      variantId: "gid://xxx",
      quantity: 1
    }
  ],
  purchasingEntity: {
    purchasingCompany: {
      companyId: "gid://xxx",
      companyContactId: "gid://xxx",
      companyLocationId: "gid://xxx"
    }
  },
  shippingAddress: {
    address1: "CLand Tower",
    address2: "CHAHA",
    city: "Ha Noi",
    company: "test 123",
    countryCode: "VN",
    firstName: "tét",
    lastName: "tét",
    phone: null,
    provinceCode: null,
    zip: "10000"
  },
  billingAddress: {
    address1: "CLand Tower",
    address2: "CHAHA",
    city: "Hà Nội",
    company: "test 123",
    countryCode: "VN",
    firstName: "tét",
    lastName: "tét",
    phone: "+84335045675",
    provinceCode: null,
    zip: "10000"
  },
  paymentTerms: {
    paymentSchedules: {
      dueAt: null,
      issuedAt: "2025-01-16T02:53:04+00:00"
    },
    paymentTermsTemplateId: "gid://xxx"
  }
}

Output

I am setting up a selected product within a catalog for B2B customers and configuring the payment term for that company location.

1 Like

Do you get the value for invoiceUrl returned in the code of the mutation return?

@Liam-Shopify, Yes, I did receive the URL.

And so you want to display the url link on the page that the customer sees?

1 Like

@Liam-Shopify, I want that when the deposit is set to 15%, the draft order displayed to the customer to show the “Total Due Today” as 15% of the total order value so they can make a partial payment according to the payment terms. However, when setting up and creating the draft order with the payment term ID, the “Total Due Today” always shows as 0.

1 Like

Hi @Liam-Shopify,

I’m facing the same issue with deposits when creating a DraftOrder using the GraphQL Admin API. The API only provides options for paymentTemplateId and lacks a direct deposit field. As a result, when using paymentTerm settings for B2B customers (e.g., a 20% deposit), the created DraftOrder doesn’t reflect the required deposit, even though orders created via the storefront cart do.

Is there a way to ensure that DraftOrders apply the same deposit terms as regular orders?

@Liam-Shopify Could you take a look at this issue?

@Liam-Shopify

Any updates on this matter would be appreciated, our team is facing a very similar issue trying to automate draft order invoicing of high-value items using the admin API.

Thanks,
Justin

Were you guys able to figure this out?

The deposit requirement setting configured in the admin refers to orders made on the storefront only:

If you need draft orders made in the admin or Admin API to require a deposit as well, then you would need to use a Payment Customization Function to configure the requirement.

If you’re interested in learning more, here’s a tutorial on setting payment terms using a Payment Customizations Function.

Implementation advice/considerations for this scenario:

  • Use the INVOICE_SENT event trigger in the paymentTermsSet operation.
  • The invoice notification will not be updated to reflect logic of the Function (e.g. it may say $0 due today by default). Invoice notifications will need to be updated separately.
  • The paymentTermsSet operation of Payment Customization Functions is only available for shops on the Plus plan.