Process Flow
Shuttle provide 4 actions for managing payment links:
- Create a new payment link
- Get a payment link
- Update an existing payment link
- Delete a payment link
And generates the following notifications:
PAYMENT_LINK.CREATED- Payment link has been createdPAYMENT_LINK.UPDATE- Payment link details have been updatedPAYMENT_LINK.PENDING- Payment submitted, however awaiting authorizationPAYMENT_LINK.FAILED- Payment was declined, after previously being pendingPAYMENT_LINK.COMPLETE- Payment successfulPAYMENT_LINK.EXPIRED- Payment link expiredPAYMENT_LINK.ARCHIVE- Payment link archived (ie deleted)
Typical Process Flow
Typically you will want to implement the following:
- On your desired trigger, "Create a payment link", putting an id for your workflow in a
statefield - If you care about payment events, handle the following webhooks, filter
stateor your workflow id, whereactionequals:PAYMENT_LINK.COMPLETE: to recognize the payment has been completed, eg place orderPAYMENT_LINK.PENDING: to recognize the payment is underway, eg reserve stockPAYMENT_LINK.FAILED: to recognize the payment has been declined AFTER the customer has left the payment page (ie after a payment was previously pending), eg release stock, or send them a new payment linkPAYMENT_LINK.EXPIRED: to recognize the payment link has expired, eg send them a new payment link
stateandaction, retrieve the payment link using "Get a payment link".
Tip! Shuttle's workflow automation integrations presents state as 9 discrete values as per below, if using a combination of programatic usage and workflow automation, you should use a similiar format for compatibility:
payment_link = {
"id": "pl_1234_567890",
"url": "https://app.shuttleglobal.com/cp/links/pl_1234_567890",
"options: {},
"state": {
"state1": "INVOICE_PAYMENT",
"state2": "",
"state3": "",
"state4": "",
"state5": "",
"state6": "",
"state7": "",
"state8": "",
"state9": ""
}
}
webhook = {
"action": "PAYMENT_LINK.COMPLETE",
"payment_link": "pl_1234_567890",
"contract": "co_1234_10151",
"transaction": "tr_1234_10150",
"payment_method": "pm_1234_10141",
"state": {
"state1": "INVOICE_PAYMENT",
"state2": "",
"state3": "",
"state4": "",
"state5": "",
"state6": "",
"state7": "",
"state8": "",
"state9": ""
},
...
}Updated 11 days ago