Processing Payment

Step 3: Processing Payment

To continue to process the order, you should mark it as paid.

There are two ways you can go about doing that:

  1. You can ask our customer success manager (success@flyt.io) whitelist your API Key. This way you can process payments directly in your app, and proceed with the order by marking it as paid
  2. OR you can use our Payments product and we can process the payment for you in a PCI compliant way.

Marking an order as paid with a white-listed API Key

To mark an order as paid, you use the /ordering/v3/order/{orderId}/mark-as-paid endpoint.

Request

POST /ordering/v3/order/{orderId}/mark-as-paid
{
	"paymentMethod": "card",
	"payment": {
		"itemsInCart": {
			"incTax": 2000,
			"tax": 400
		},
		"adjustments": [
			{
				"name": "Delivery Charge",
				"price": {
					"incTax": 250,
					"tax": 50
				}
			},
			{
				"name": "Bag Fee",
				"price": {
					"incTax": 200,
					"tax": 40
				}
			}
		],
		"final": {
			"incTax": 2450,
			"tax": 490
		}
	}
}
field required type description
paymentMethod Yes Enum('card', 'cash') Payment method of order
payment No Object
payment.itemsInCart Yes Object Total amount of all items in order, excluding adjustments
payment.itemsInCart.incTax Yes Integer Amount in pence
payment.itemsInCart.tax No Integer Tax amount in pence
payment.adjustments No Array
payment.adjustments [ n ] .name Yes String Name of the adjustment
payment.adjustments [ n ] .price Yes Object
payment.adjustments [ n ] .price.incTax Yes Integer Adjustment price in pence
payment.adjustments [ n ] .price.tax No Integer Tax amount in pence
payment.final Yes Object
payment.final.incTax Yes Integer Total amount of items and adjustments, in pence
payment.final.tax No Integer Total of all tax amounts, in pence

Response

201 CREATED (empty response)

Marking an order as paid with the result of a Flyt payment

To use our Payments product, refer to the documentation here. The result of processing a payment is a payment-hash.

You can then use the payment-hash to mark an order as paid as such:

Request

POST /ordering/v3/order/{orderId}/mark-as-paid/payment/{paymentHash}

Response

201 CREATED (empty response)