In this guide we will run through the process for paying for an order with credit card and submitting the order for fulfillment.
Request the order by ID (see Location header value returned on POST response).
Note the order status is "Pending", the total is 30.50, 0.0 has been paid, and paymentOptions includes creditCard.
GET /v3/orders/98077
{ "email": "[email protected]", "status": "Pending", "createdDateUtc": "2014-05-30T20:33:14.513Z", "total": 30.50, "subtotal": 27.50, "paid": 0.0, "token": "92e325ab-2b96-429f-ae67-3815a1b3449b", "paymentOptions": [ "creditCard", "giftCard" ], "fees": [ { "amount": 1.50, "waived": false, "quantity": 2 } ], "expirationDateUtc": "2014-05-30T20:46:06.643Z", "_embedded": { "products": [ { "sku": "TICKET-GA-26250946-ADULT", "quantity": 2, "status": "Held", "cost": 13.75, "name": "ADULT Ticket", "theatre": "AMC Town Center 20", "movie": "One Direction Concert Movie", "showDateTime": "2014-05-30 18:15", "performanceNumber": 97040, "format": "RealD 3D", "internalReleaseNumber": 38895, "expirationDate": "2014-05-30T20:46:06.643Z", "_links": { "self": { "href": "https://api.amctheatres.com/v3/orders/98096/products/1", "templated": false }, "https://api.amctheatres.com/rels/v2/movie": { "href": "https://api.amctheatres.com/v2/movies/40722", "templated": false }, "https://api.amctheatres.com/rels/v2/theatre": { "href": "https://api.amctheatres.com/v2/theatres/38", "templated": false } } } ], "payments": [ ] }, "_links": { "self": { "href": "https://api.amctheatres.com/v3/orders/98096", "templated": false }, "payments": { "href": "https://api.amctheatres.com/v3/orders/98096/payments", "templated": false }, "products": { "href": "https://api.amctheatres.com/v3/orders/98096/products", "templated": false } } }
Request credit card payment be added to the order.
Note we're specifying "braintree" as our payment gateway (this is always true for creditCard payments) and we're passing Braintree's merchantTransactionId.
POST /v3/orders/98077/payments
{ "type":"creditCard", "amount": 30.50, "gateway": "braintree", "merchantTransactionId": "cr8tbw" }
HTTP/1.1 201 Created Location: https://api.amctheatres.com/v3/orders/98077/payments/1
Request the order by ID.
Note the status is still "Pending" but now the paid amount is 30.50 which matches the total, the payment status is Authorized, and the fulfill link is now returned.
GET /v3/orders/98077
{ "email": "[email protected]", "status": "Pending", "createdDateUtc": "2014-05-30T20:33:14.513Z", "total": 30.50, "subtotal": 27.50, "paid": 30.50, "token": "92e325ab-2b96-429f-ae67-3815a1b3449b", "paymentOptions": [ "creditCard", "giftCard" ], "fees": [ { "amount": 1.50, "waived": false, "quantity": 2 } ], "expirationDateUtc": "2014-05-30T20:46:06.643Z", "_embedded": { "products": [ { "sku": "TICKET-GA-26250946-ADULT", "quantity": 2, "status": "Held", "cost": 13.75, "name": "ADULT Ticket", "theatre": "AMC Town Center 20", "movie": "One Direction Concert Movie", "showDateTime": "2014-05-30 18:15", "performanceNumber": 97040, "format": "RealD 3D", "internalReleaseNumber": 38895, "expirationDate": "2014-05-30T20:46:06.643Z", "_links": { "self": { "href": "https://api.amctheatres.com/v3/orders/98096/products/1", "templated": false }, "https://api.amctheatres.com/rels/v2/movie": { "href": "https://api.amctheatres.com/v2/movies/40722", "templated": false }, "https://api.amctheatres.com/rels/v2/theatre": { "href": "https://api.amctheatres.com/v2/theatres/38", "templated": false } } } ], "payments": [ { "type": "Visa", "balance": 0.0, "amount": 30.50, "status": "Authorized", "_links": { "self": { "href": "https://api.amctheatres.com/v3/orders/98102/payments/1", "templated": false } } } ] }, "_links": { "self": { "href": "https://api.amctheatres.com/v3/orders/98096", "templated": false }, "payments": { "href": "https://api.amctheatres.com/v3/orders/98096/payments", "templated": false }, "products": { "href": "https://api.amctheatres.com/v3/orders/98096/products", "templated": false }, "fulfill": { "href": "https://api.amctheatres.com/v3/orders/98102/fulfill", "templated": false } } }