Merchant API
API Endpoints

Order

⚬ Get

An order object will not exist unless the payment is authorized.

Request

curl -v -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <temporary-bearer-token>' \ -X GET https://api.sandbox.nymcard.com/api/v1.0/orders/<reference>/
shell
{ "order_id": "9d7f31ac-d030-41e4-adf1-8769cae32520", "reference": "TDU4YSXB3RY89OG", "display_reference": "TDU4YSXB3RY89OG", "description": "Order #TDU4YSXB3RY89OG Description:", "total": "200.9900", "currency": "QAR", "tax_amount": null, "shipping_amount": null, "discount": null, "customer": { "first_name": null, "last_name": null, "email": "", "phone": null }, "billing_address": null, "shipping_address": null, "lines": [], "created_at": "2020-12-13T07:45:25.168325Z", "updated_at": "2020-12-13T07:45:29.548974Z", "order_number": "9QG738WMHKRW", "status": "OPENED", "total_refund": "0", "capture_expiration": "2020-12-18T07:45:25.168325+00:00", "employee_name": "Nymcard Merchant" }
json
  • GET https://api.sandbox.nymcard.com/api/v1.0/orders/<reference>/

You must replace reference with the merchant's unique reference ID.

Response

Excluding values at checkout POST

ParameterTypeDescription
statusStringEither OPENED or COMPLETED *
total_refundStringThe amount of Refunds done on the order
employee_nameStringReference ID
capture_expirationStringCapture expiry time stamp
  • OPENED: The payment is authorized but not captured
  • COMPLETE: The payment is captured

⚬ Capture

curl -v -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <temporary-bearer-token>' \ -X POST https://api.sandbox.nymcard.com/api/v1.0/orders/<reference>/capture/
shell

This endpoint captures an order that has been approved by Nymcard's payment portal.

Request

  • POST https://api.sandbox.nymcard.com/api/v1.0/orders/<reference>/capture/

You must replace reference with the merchant's unique reference ID.

Response

ParameterTypeDescription
statusStringTransaction status: SUCCESS or FAILURE
order_idStringunique order uuid
amountStringThe amount captured (returned on SUCCESS)
currencyCurrencyISO 4217 order currency (returned on SUCCESS)
typeStringTransaction type "CAPTURE" (returned on SUCCESS)

Exceptions

CodeDescription
404Transaction does not exist

⚬ Refund

curl -v -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <temporary-bearer-token>' \ -X POST -d '{ "total": "100.00", "currency": "QAR" }' https://api.sandbox.nymcard.com/api/v1.0/orders/<reference>/refund/
shell

This endpoint refunds an order. This can be done at any time there is no window.

Request

POST https://api.sandbox.nymcard.com/api/v1.0/orders/<reference>/refund/

Query Parameters

ParameterTypeDescriptionRequired
totalDecimalTotal amount of the order, including tax, shipping and discount
currencyCurrencyISO 4217 order currency

You must replace reference with the merchant's unique reference ID.

Response

ParameterTypeDescription
statusStringTransaction status: SUCCESS or FAILURE
order_idStringunique order uuid
amountStringThe amount captured
currencyCurrencyISO 4217 order currency
typeStringTransaction type "REFUND"
transaction_idStringunique uuid for the transaction

Exceptions

CodeDescription
406Transaction is already refunded or Transaction is still open
404Transaction does not exist