send customer a checkout link afte4r checkout

send customer a checkout link afte4r checkout

kwangEra
New Member
12 0 0

Currently, i have a system where we can create a order via the draft order API, than completes the order (unpaid)  in which the customer receives a invoice.
However, one of the biggest issues we're having is that the invoice sent to the customer does not contain a checkout link.
i've been at this for a phew days now and i can't seen to find a way to send the customer a checkout link after a order is created or a draft order is completed.
The only way around this is that when the draft order is created the API respons returns a object of type invoice_url.
I can send the customer the invoice_url directly after the draft order is created, however that is not ideal as we want the customer to receive the checkout link after the order is created (Draft order completed).
Is there any way around this that i'm misssing?

Replies 7 (7)

kwangEra
New Member
12 0 0

the issue is that if i use the send draft invoice API to send the customer a invoice, than when the draft order is completed the customer will receive another invoice (one without a checkout link) and im also unsure if the customer pays via the draft invoice, will the actual order be marked as paid/completed?

JustinW
Shopify Partner
15 0 4

Kwang,

Have you customized the draft order invoice? It should contain the following liquid for the checkout url:

 

{{ checkout_payment_collection_url }}

 

 

This is assuming you are using the draft_orders/order_id/send_invoice.json enpoint for draft orders.

What invoice is sent when the draft order is completed? This is the receipt of the order, which indicates the order in Shopify is paid/completed.

Helping customers integrate their E-Commerce and Salesforce data
kwangEra
New Member
12 0 0

im using the 

/admin/api/2022-10/draft_orders/994118539/complete.json?payment_pending=true
to complete the order, than the customer gets a invoice.
However, the invoice doesn't contain a payment link since the actual order is created, that is what we want though and the customer.
 
JustinW
Shopify Partner
15 0 4

Using the endpoint you shared above does not send an invoice. Please try using the send_invoice.json endpoint and share your results.

Helping customers integrate their E-Commerce and Salesforce data
kwangEra
New Member
12 0 0

i tried that. 
But once the draft order is published, it returns the error "Can't send payment link since order is already paid".
But when i completed the draft order, the payment_status is set to pending. 

kwangEra
New Member
12 0 0

so i tried this.
I sent the checkout link as soon as the draft order is created before completing it.
Than i get this error.
Capture.PNG

JustinW
Shopify Partner
15 0 4

What is the status you are using when creating a new draft order? The status should be set to 'open' 

Helping customers integrate their E-Commerce and Salesforce data