Important |
To use the |
You can use the orders API to update a tip, or gratuity, amount in an existing credit card payment for an order.
You can only update the tip on credit card payments that are not yet
captured. The paymentStatus
for the payment must be
AUTHORIZED
. Capturing a payment begins the process of settling
that payment with credit card providers. Credit card payments are usually
captured at the end of the business day for a restaurant.
To update a tip amount, you send a PATCH
request to the
/orders/
endpoint of the Toast orders API. You include a {orderGuid}
/checks/{checkGuid}
/payments/{paymentGuid}
Payment
JSON
object with an updated tipAmount
value. The
paymentStatus
on the updated payment must be
AUTHORIZED
, and the type
must be
CREDIT
.
For more information, see Update a tip amount in the API reference.
To update the tip amount for an existing payment
-
Find the Toast platform GUIDs of the order, the check, and the payment you are updating. For more information on locating order and check GUIDs, see Finding an order or check guid.
-
The response from the
POST
request to create an order contains the order, check, and payment GUIDs. -
If you know the order GUID, you can send a
GET
request to get the order details, which include the check and payment GUIDs. See Getting detailed information about one order. -
If you do not know the order GUID, you can send a
GET
request to get the details for orders that were updated during a specific time interval. See Getting detailed information about multiple orders. The order details include the order, check, and payment GUIDs.
-
-
Create a JSON
Payment
object that includes atipAmount
value. Set thetipAmount
value to the updated tip amount. For an example, see Example Payment object that updates the tip amount for an existing payment.For this type of request, you can only include the
tipAmount
value. The providedtipAmount
value completely replaces any previous tip amount on the payment. -
Send a
PATCH
request to the/orders/
endpoint of the orders API.{orderGuid}
/checks/{checkGuid}
/payments/{paymentGuid}
In the REST request path parameters, include the Toast platform GUID of the order, the check, and the payment.
In the request message body, include the
Payment
object that contains the updatedtipAmount
value. -
Examine the response that you receive from the orders API. Verify that your request is processed successfully. For an example, see Example response when you update a tip in an existing payment.
The following example shows a Payment
object that
updates the tip amount for an existing payment.
{ "tipAmount": 10.00 }
The following example shows a response for a PATCH
request to the
/orders/
endpoint of the orders API.
{orderGuid}
/checks/{checkGuid}
/payments/{paymentGuid}
{ "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": 10.00, "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": "2021-12-22T14:43:04.036+0000", "cardEntryMode": null, "paymentStatus": "AUTHORIZED", "paidBusinessDate": 20211222, "last4Digits": "1111", "refund": null } ], [contents omitted] } ], [contents omitted] }
The Toast platform GUID of the order that you updated a tip amount in. |
|
The Toast platform GUID of the check that you updated a tip amount in. |
|
The Toast platform GUID of the payment that you updated a tip amount in. |
|
The updated tip amount. The |
|
When you update a tip amount, the |