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?

@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