Merchant API
API Endpoints

Checkout

⚬ Workflow

⚬ Create a Checkout

curl -v -H 'Accept: application/json; indent=4' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <temporary-bearer-token>' \ -X POST -d '{ "reference": "198776653", "display_reference": "198776653", "description": "Order #198776653", "total": "300.00", "currency": "QAR", "confirm_callback_url": "https://mywebsite.com/?success", "reject_callback_url": "https://mywebsite.com/?failed", "order": { "tax_amount": null, "shipping_amount": null, "discount": null, "customer": { "first_name": "George", "last_name": "Clooney", "email": "g.clooney@example.com", "phone": "+974559993322" }, "billing_address": { "title": "Mr", "first_name": "George", "last_name": "Clooney", "line1": "My House 12", "line2": "", "line3": "", "line4": "Dubai", "state": "", "postcode": "4400", "country": "QA", "phone": "+974559993322" }, "shipping_address": { "title": "Mr", "first_name": "George", "last_name": "Clooney", "line1": "My House 12", "line2": "", "line3": "", "line4": "Dubai", "state": "", "postcode": "4400", "country": "QA", "phone": "+974559993322" }, "lines": [ { "sku": "sku-1", "reference": "reference-1", "title": "Livingston All-Purpose Tight", "upc": "upc-1", "quantity": 1, "price": "300.00", "currency": "QAR", "image_url": "http://mywebsite.com/products/mh07-gray_main_2.jpg" } ] } }' https://api.sandbox.nymcard.com/api/v1.0/checkouts/
shell

The above command returns JSON structured like this:

{ "reference": "198776653", "display_reference": "198776653", "description": "Order #198776653", "total": "300.00", "currency": "QAR", "confirm_callback_url": "https://mywebsite.com/?success", "reject_callback_url": "https://mywebsite.com/?failed", "order": { "tax_amount": null, "shipping_amount": null, "discount": null, "customer": { "first_name": "George", "last_name": "Clooney", "email": "g.clooney@example.com", "phone": "+974559993322" }, "billing_address": { "title": "Mr", "first_name": "George", "last_name": "Clooney", "line1": "My House 12", "line2": "", "line3": "", "line4": "Dubai", "state": "", "postcode": "4400", "country": "QA", "phone": "+974559993322" }, "shipping_address": { "title": "Mr", "first_name": "George", "last_name": "Clooney", "line1": "My House 12", "line2": "", "line3": "", "line4": "Dubai", "state": "", "postcode": "4400", "country": "QA", "phone": "+974559993322" }, "lines": [ { "line_id": "b05508f7-825f-413a-8fa6-ce6fff24315d", "sku": "sku-1", "reference": "reference-1", "notes": null, "title": "Livingston All-Purpose Tight", "upc": "upc-1", "quantity": 1, "price": "300.00", "currency": "QAR", "image_url": "http://mywebsite.com/products/mh07-gray_main_2.jpg" } ] }, "checkout_url": "https://sandbox.nymcard.com/checkout/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1ODE5MzQ5NDAsImNoZWNrb3V0X2lkIjoiYmM2ODg5ZDctZDc5Mi00MDAyLWE4OGQtOTgwZjJjNzg0Mjk1In0.K-U4pRnfaNZ4aCKR-OFy9zVrIywhBaNlCOTAZEmzaLE" }
json

This endpoint creates a merchant checkout. Upon a successful request, a checkout_url link will be provided for the merchant's customer to process payment at Nymcard's payment portal. If payment is successful, the customer will be redirected to the provided confirm_callback_url link. Else if payment is rejected, the customer will be redirected to the provided reject_callback_url link.

HTTP Request

POST https://api.sandbox.nymcard.com/api/v1.0/checkouts/

Query Parameters

ParameterTypeDescriptionRequired
referenceStringMerchant's unique reference ID
display_referenceStringDisplay of merchant's reference ID
descriptionStringOrder description
totalDecimalTotal amount of the order, including tax, shipping and discount
currencyCurrencyISO 4217 order currency. Currently supports "QAR" for sandbox and "QAR" or "SAR" for production
confirm_callback_urlStringMerchant URL for confirmed order
reject_callback_urlStringMerchant URL for rejected order
orderOrderOrder information

Order

{ "tax_amount": null, "shipping_amount": null, "discount": null, "customer": {}, "billing_address": {}, "shipping_address": {}, "lines": [] }
json
ParameterTypeDescriptionRequiredNullable
tax_amountDecimalTax amount
shipping_amountDecimalShipping amount
discountDecimalDiscount amount
customerCustomer ObjectCustomer information
billing_addressBilling ObjectBilling address
shipping_addressShipping ObjectShipping address
linesLines ArrayOf(Object)A list of line objects

Customer

{ "first_name": "George", "last_name": "Clooney", "email": "g.clooney@example.com", "phone": "+974559993322" }
json
ParameterTypeDescriptionRequired
first_nameStringFirst name
last_nameStringLast name
emailStringA valid email address
phoneStringPhone number

Billing

{ "title": "Mr", "first_name": "George", "last_name": "Clooney", "line1": "My House 12", "line2": "", "line3": "", "line4": "Dubai", "state": "", "postcode": "4400", "country": "QA", "phone": "+974559993322" }
json
ParameterTypeDescriptionRequired
titleStringTitle
first_nameStringFirst name
last_nameStringLast name
line1StringStreet address
line2StringApartment, suite, floor, etc.
line3StringOptional
line4StringCity
stateStringState or Region or Province
postcodeStringPostal Code
countryCountryISO 3166 alpha-2 country code
phoneStringPhone number

Shipping

{ "title": "Mr", "first_name": "George", "last_name": "Clooney", "line1": "My House 12", "line2": "", "line3": "", "line4": "Dubai", "state": "", "postcode": "4400", "country": "QA", "phone": "+974559993322" }
json
ParameterTypeDescriptionRequired
titleStringTitle
first_nameStringFirst name
last_nameStringLast name
line1StringStreet address
line2StringApartment, suite, floor, etc.
line3StringOptional
line4StringCity
stateStringState or Region or Province
postcodeStringPostal Code
countryCountryISO 3166 alpha-2 country code
phoneStringPhone number

Lines

{ "sku": "sku-1", "reference": "reference-1", "title": "Livingston All-Purpose Tight", "upc": "upc-1", "quantity": 1, "price": "300.00", "currency": "QAR", "image_url": "http://mywebsite.com/products/mh07-gray_main_2.jpg" }
json
ParameterTypeDescriptionRequired
skuStringLine SKU
referenceStringReference ID
titleStringLine title
upcStringLine UPC
quantityIntegerLine quantity
priceStringLine price, excluding tax, shipping and discount
currencyCurrencyISO 4217 order currency. Currently supports "QAR" for sandbox and "QAR" or "SAR" for production
image_urlStringLine image url