|
Important |
|
To use the |
You can use the orders API to add authorized credit card payments and alternative payments to a check on an existing order.
To add payments to an existing check, you send a POST
request to the
/orders/
endpoint of the Toast orders API. To include the information about the
payments, you include an array of JSON {orderGuid}/checks/{checkGuid}/paymentsPayment objects. The
type value for the payments must be CREDIT or
OTHER. Credit card payments must be authorized before you add
them.
For more information, see Post payments in the Toast API reference.
Add payment to an existing check
-
Find the Toast platform GUIDs of the order and the check that you are adding payment to. For more information on locating these GUIDs, see Finding an order or check GUID.
-
Authorize the credit card payments that you are adding. For more information, see Credit card payments.
When you add payments to the check, you include the UUIDs of the authorized credit card payments.
-
Create an array of JSON
Paymentobjects that contain information about the payments you are adding. For each payment, you use the UUID as the value ofguid.For information about the
Paymentobject, see the orders API reference documentation. -
Send a
POSTrequest to the/orders/endpoint of the orders API.{orderGuid}/checks/{checkGuid}/paymentsIn the request path parameters, include the Toast platform GUID of the order and the check.
In the request body, include the array of
Paymentobjects that contains information about the payments to add.For more information about the orders API payments endpoint, see the reference documentation.
-
Examine the response data that you receive from the orders API. Verify that your request is processed successfully. For an example, see Example response data when adding a payment to an existing check.
Add an alternative payment type to an existing check
-
Find the Toast platform GUIDs of the order and the check that you are adding payment to. For more information on locating these GUIDs, see Finding an order or check GUID.
-
Find the GUID of the alternative payment type you want to apply. To get the list of alternative payment types available for the location, send a
GETrequest to the/alternatePaymentTypesendpoint of the configuration API. For more information about alternative payment types, see the reference documentation. -
For each alternative payment, set
typetoOTHERand include the alternate payment type GUID as the value ofotherPayment.guid.For information about the
Paymentobject, see the orders API reference documentation. -
Send a
POSTrequest to the/orders/endpoint of the orders API.{orderGuid}/checks/{checkGuid}/paymentsIn the request path parameters, include the Toast platform GUID of the order and the check.
In the request body, include the array of
Paymentobjects that contains information about the payments to add.For more information about the orders API payments endpoint, see the reference documentation.
-
Examine the response data that you receive from the orders API. Verify that your request is processed successfully. For an example, see Example response data when adding a payment to an existing check.
The following example shows an array of Payment objects
to add payments to a check contained in an existing order.
[
{
"guid": "7c65cc16-15bd-496e-886b-a3c080b36100",
"type": "CREDIT",
"amount": 35.21,
"tipAmount": 15
},
{
"type": "OTHER",
"amount": 48.74,
"tipAmount": 20,
"otherPayment": {
"guid": "28645ad1-b795-44f6-ad9f-baeeb07fa03d"
}
]|
The UUID of the credit card payment that you authorized in the Toast credit cards API. For more information, see Credit card payments. |
|
|
The
|
|
|
The currency amount to apply to the check price in the added payment. |
|
|
The currency amount of a tip or gratuity in the added payment. |
|
|
You can add one or more payments in the array. This example adds two payments to the check. |
|
|
The |
The following example shows example response data for a
POST request to the
/orders/
endpoint of the orders API.
{orderGuid}/checks/{checkGuid}/payments
{
"guid": "99e42b9c-2f45-4b01-ab90-de4169f6dd29",
"entityType": "Order",
[contents omitted]
"checks": [
{
"guid": "b7dba08f-db0c-4db3-8ce8-ef25aa0cc492",
"entityType": "Check",
[contents omitted]
"payments": [
{
"guid": "b7372d29-09fd-46bc-b95e-3c1ab4e77fae",
"entityType": "OrderPayment",
"externalId": null,
"originalProcessingFee": null,
"amount": 50.12,
"tipAmount": 20.34,
"amountTendered": null,
"cashDrawer": null,
"cardType": "VISA",
"lastModifiedDevice": {
"id": null
},
"refundStatus": "NONE",
"houseAccount": null,
"type": "CREDIT",
"voidInfo": null,
"otherPayment": null,
"mcaRepaymentAmount": null,
"createdDevice": {
"id": null
},
"paidDate": "2019-03-31T14:43:04.036+0000",
"cardEntryMode": null,
"paymentStatus": "AUTHORIZED",
"paidBusinessDate": 20190331,
"last4Digits": "1111",
"refund": null
}
],
[contents omitted]
}
],
[contents omitted]
}
|
The Toast platform GUID of the order that you added payments to. |
|
|
The Toast platform GUID of the check that you added payments to. |
|
|
The |
|
|
The Toast platform GUID of a payment that you added. |