# Create Payment
To authorize a payment, make a call to the Payment endpoint. It will handle the authorization process by verifying payment details, checking funds, and meeting security requirements. Upon successful authorization, you'll receive a response containing a payment authorization code and other fields for further processing.
There are 3 distinct methods through which you can request a payment
- Using full card details - (requires SAQ D PCI compliance)
- Using a credit card nonce
- Using a credit card token
# Using full card details
POST: https://api.openacquiring.com/v1/merchants/YOUR_MERCHANT_ID/payment
Request example
- Shell
- JavaScript
curl -X POST \
https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment \
-H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
-H 'content-type: application/json' \
-d '{
"intent": "sale",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card": {
"number": "4543474002249996",
"expire_month": "06",
"expire_year": "2025",
"cvv2": "956",
"name": "Tom Hanks"
}
},
"payer_info": {
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "mu",
"postal_code": "72101",
"state": "",
"phone": {
"country_code": "230",
"number": "57976041"
}
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q\u003d0.9,image/avif,image/webp,*/*;q\u003d0.8",
"color_depth": 24,
"java_enabled": false,
"javascript_enabled": true,
"language": "en-US",
"screen_height": "1080",
"screen_width": "1920",
"timezone_offset": -240,
"user_agent": "Mozilla/5.0 \u0026 #40;Windows NT 10.0; Win64; x64; rv:103.0\u0026#41; Gecko/20100101 Firefox/103.0",
"ip": "12.2.12.0",
"channel": "Web"
}
},
"payee": {
"email": "mail@test.com",
"merchant_id": "w3z8dfhkzvfq0j9n"
},
"transaction": {
"type": "1",
"amount": {
"currency": "USD",
"total": "300"
},
"invoice_number": "123455",
"items": [{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "20",
"currency": "USD",
"url": "",
"image": "",
"tangible": "true"
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "20",
"currency": "USD",
"url": "",
"image": "",
"tangible": "true"
}
]
}
}'
Response example
{
"id": "2JHY1CB6CR8N0FZK43WU",
"reference_id": "2JHY1CB6CR8N0FZK43WU",
"state": "authorised",
"result": {
"authorisation_code": "590622",
"code": "0000",
"description": "Approved"
},
"intent": "AUTH",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card": {
"id": "20abc6eb-35fd-427e-b57e-c7eea99dd423",
"type": "Visa",
"expire_month": 6,
"expire_year": 2025,
"name": "Tom Hanks",
"cvv_check": "Y",
"avs_check": "S",
"last4": "9996",
"bin": "454347",
"bin_data": {
"bin": "454347",
"country_code": "MU",
"country_name": "Mauritius",
"bank_name": "MCB",
"card_scheme": "Visa",
"card_type": "Credit",
"card_category": "1"
}
}
},
"payer_info": {
"id": "35d4d1ec-4f9d-416d-acdc-d12f4bf0c6df",
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"phone": {
"country_code": "230",
"number": "57976041"
},
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "MU",
"postal_code": "72101",
"state": ""
}
},
},
"transaction": {
"amount": {
"currency": "USD",
"total": "300"
},
"type": "1",
"mode": "1",
"items": [
{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
}
],
"shipping_address": {
"phone": {}
},
"invoice_number": "123455"
},
"custom": {},
"risk_check": true,
"three_d": {},
"create_time": "2023-06-09T18:07:37Z",
"subscriptions": null
}
TIP
- Please ensure that when processing Omannet transactions, the
intent
is set tosale
. - In case the response includes a
redirect_url
, kindly redirect your customers to that URL to complete the OTP flow.
# Using a credit card nonce
POST: https://api.openacquiring.com/v1/merchants/YOUR_MERCHANT_ID/payment
Request example
- Shell
- JavaScript
curl -X POST \
https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment \
-H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
-H 'content-type: application/json' \
-d '{
"intent": "sale",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card_nonce": {
"nonce": "9bc34749-a3cf-4f08-bf84-c817238f93df",
"name": "John Smith"
}
},
"payer_info": {
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "mu",
"postal_code": "72101",
"state": "",
"phone": {
"country_code": "230",
"number": "57976041"
}
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q\u003d0.9,image/avif,image/webp,*/*;q\u003d0.8",
"color_depth": 24,
"java_enabled": false,
"javascript_enabled": true,
"language": "en-US",
"screen_height": "1080",
"screen_width": "1920",
"timezone_offset": -240,
"user_agent": "Mozilla/5.0 \u0026 #40;Windows NT 10.0; Win64; x64; rv:103.0\u0026#41; Gecko/20100101 Firefox/103.0",
"ip": "12.2.12.0",
"channel": "Web"
}
},
"payee": {
"email": "mail@test.com",
"merchant_id": "w3z8dfhkzvfq0j9n"
},
"transaction": {
"type": "1",
"amount": {
"currency": "USD",
"total": "300"
},
"invoice_number": "123455",
"items": [{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "20",
"currency": "USD",
"url": "",
"image": "",
"tangible": "true"
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "20",
"currency": "USD",
"url": "",
"image": "",
"tangible": "true"
}
]
}
}'
Response example
{
"id": "NXWD2R715Z24XB1V80JZ",
"reference_id": "NXWD2R715Z24XB1V80JZ",
"state": "authorised",
"result": {
"authorisation_code": "923083",
"code": "0000",
"description": "Approved"
},
"intent": "AUTH",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card": {
"id": "20abc6eb-35fd-427e-b57e-c7eea99dd423",
"type": "Visa",
"expire_month": 6,
"expire_year": 2025,
"name": "John Smith",
"cvv_check": "Y",
"avs_check": "S",
"last4": "9996",
"bin": "454347",
"bin_data": {
"bin": "454347",
"country_code": "MU",
"country_name": "Mauritius",
"bank_name": "MCB",
"card_scheme": "Visa",
"card_type": "Credit",
"card_category": "1"
}
}
},
"payer_info": {
"id": "35d4d1ec-4f9d-416d-acdc-d12f4bf0c6df",
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"phone": {
"country_code": "230",
"number": "57976041"
},
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "MU",
"postal_code": "72101",
"state": ""
}
}
},
"transaction": {
"amount": {
"currency": "USD",
"total": "300"
},
"type": "1",
"mode": "1",
"items": [
{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
}
],
"shipping_address": {
"phone": {}
},
"invoice_number": "123455"
},
"custom": {},
"risk_check": true,
"three_d": {},
"create_time": "2023-06-10T17:59:47Z",
"subscriptions": null
}
TIP
- Please ensure that when processing Omannet transactions, the intent is set to sale.
- In case the response includes a redirect_url, kindly redirect your customers to that URL to complete the OTP flow.
# Using a credit card token
POST: https://api.openacquiring.com/v1/merchants/YOUR_MERCHANT_ID/payment
Request example
- Shell
- JavaScript
curl -X POST \
https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment \
-H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
-H 'content-type: application/json' \
-d '{
"intent": "sale",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card_token":{
"credit_card_id":"20abc6eb-35fd-427e-b57e-c7eea99dd423"
,"cvv2":"123"
}
},
"payer_info": {
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "mu",
"postal_code": "72101",
"state": "",
"phone": {
"country_code": "230",
"number": "57976041"
}
}
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q\u003d0.9,image/avif,image/webp,*/*;q\u003d0.8",
"color_depth": 24,
"java_enabled": false,
"javascript_enabled": true,
"language": "en-US",
"screen_height": "1080",
"screen_width": "1920",
"timezone_offset": -240,
"user_agent": "Mozilla/5.0 \u0026 #40;Windows NT 10.0; Win64; x64; rv:103.0\u0026#41; Gecko/20100101 Firefox/103.0",
"ip": "12.2.12.0",
"channel": "Web"
}
},
"payee": {
"email": "mail@test.com",
"merchant_id": "{{merchantId}}"
},
"transaction": {
"type": "1",
"amount": {
"currency": "USD",
"total": "300"
},
"invoice_number": "123455",
"items": [{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "20",
"currency": "USD",
"url": "",
"image": "",
"tangible": "true"
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "20",
"currency": "USD",
"url": "",
"image": "",
"tangible": "true"
}
]
}
}'
Response example
{
"id": "3XQWC579V8DQWF19NZ4R",
"reference_id": "3XQWC579V8DQWF19NZ4R",
"state": "authorised",
"result": {
"authorisation_code": "443143",
"code": "0000",
"description": "Approved"
},
"intent": "AUTH",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card": {
"id": "20abc6eb-35fd-427e-b57e-c7eea99dd423",
"type": "Visa",
"expire_month": 6,
"expire_year": 2025,
"name": "Tom Hanks",
"cvv_check": "Y",
"avs_check": "S",
"last4": "9996",
"bin": "454347",
"bin_data": {
"bin": "454347",
"country_code": "MU",
"country_name": "Mauritius",
"bank_name": "MCB",
"card_scheme": "Visa",
"card_type": "Credit",
"card_category": "1"
}
}
},
"payer_info": {
"id": "35d4d1ec-4f9d-416d-acdc-d12f4bf0c6df",
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"phone": {
"country_code": "230",
"number": "57976041"
},
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "MU",
"postal_code": "72101",
"state": ""
}
}
},
"transaction": {
"amount": {
"currency": "USD",
"total": "300"
},
"type": "1",
"mode": "1",
"items": [
{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
}
],
"shipping_address": {
"phone": {}
},
"invoice_number": "123455"
},
"custom": {},
"risk_check": true,
"three_d": {},
"create_time": "2023-06-10T18:07:16Z",
"subscriptions": null
}
TIP
- Please ensure that when processing Omannet transactions, the intent is set to sale.
- In case the response includes a redirect_url, kindly redirect your customers to that URL to complete the OTP flow.
# Request
To proceed with a sale or authorized payment for future capture, you will need to include the payment details within the JSON request body. Depending on your specific requirements, set the intent parameter to either "sale" or "auth".
It is also essential to provide the necessary "payer" and "transaction" details.
The type of payment that will be created is determined by the specific combination of the "payment_method" and "funding_instrument" parameters.
# Header parameters
The request require a Basic
authentication in the header. For more information about HTTP request headers, see HTTP request headers.
# Request parameters
Parameter | Type | Description |
---|---|---|
merchant_id required | string | Encrypted Merchant account identifier for the Merchant |
# Request body
Parameter | Type | Description | Value |
---|---|---|---|
intent required | enum | Encrypted Merchant account identifier for the Merchant | sale . Makes an immediate payment. auth . Authorizes a payment for capture later |
payer required | object | The source of the funds for this payment | |
transaction required | object | Defines what the payment is for and who fulfills the payment | |
payee | object | The payee who receives the funds and fulfills the order | |
custom | object | Free-form field for the use of clients | |
capture_delay | decimal | The payment will be captured after the number of hours that you specify, - If Value is not specified and intent is Auth, then the transaction should be captured manually. - If Value is specified and equal to 0 and intent is AUTH, then the transaction is captured after the default period of 7 days. - If Value is specified and intent is AUTH, then the transaction is captured after the specified number of hours. | Value cannot be > 168 hours (7 days) |
metadata | ArrayOf(KeyValuePair(string, string)) | Contains additional information about the transaction |
# browser_info
Parameter | Type | Description | Value |
---|---|---|---|
accept_header | string | The accepted header value of the shopper's browser | "text/html,application/xhtml+xml,application/xml;q\u003d0.9,image/avif,image/webp,/;q\u003d0.8" |
color_depth | integer | The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's screen.colorDepth property. Accepted values - 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. | 24 |
java_enabled | bool | Boolean value indicating if the shopper's browser is able to execute Java. | false |
javascript_enabled | bool | Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. | true |
language | string | The navigator.language value of the shopper's browser (as defined in IETF BCP 47). | en-US |
screen_height | integer | The total height of the shopper's device screen in pixels. | 1080 |
screen_width | integer | The total width of the shopper's device screen in pixels. | 1920 |
timezone_offset | integer | Time difference between UTC time and the shopper's browser local time, in minutes. | -240 |
user_agent | string | The user agent value of the shopper's browser | "Mozilla/5.0 \u0026 #40;Windows NT 10.0; Win64; x64; rv:103.0\u0026#41; Gecko/20100101 Firefox/103.0" |
ip | string | Payer browser ip address | "12.2.12.0" |
channel | string | The platform where a payment transaction takes place. by default it is Web (iOS, Android, Web) | "Web" |
# Response
{
"id": "2JHY1CB6CR8N0FZK43WU",
"reference_id": "2JHY1CB6CR8N0FZK43WU",
"state": "authorised",
"result": {
"authorisation_code": "590622",
"code": "0000",
"description": "Approved"
},
"intent": "AUTH",
"payer": {
"payment_type": "CC",
"funding_instrument": {
"credit_card": {
"id": "20abc6eb-35fd-427e-b57e-c7eea99dd423",
"type": "Visa",
"expire_month": 6,
"expire_year": 2025,
"name": "Tom Hanks",
"cvv_check": "Y",
"avs_check": "S",
"last4": "9996",
"bin": "454347",
"bin_data": {
"bin": "454347",
"country_code": "MU",
"country_name": "Mauritius",
"bank_name": "MCB",
"card_scheme": "Visa",
"card_type": "Credit",
"card_category": "1"
}
}
},
"payer_info": {
"id": "35d4d1ec-4f9d-416d-acdc-d12f4bf0c6df",
"email": "tomhank@gmail.com",
"name": "Tom Hanks",
"billing_address": {
"phone": {
"country_code": "230",
"number": "57976041"
},
"line1": "18 Avenue",
"line2": "cassidy",
"city": "Rose-Hill",
"country_code": "MU",
"postal_code": "72101",
"state": ""
}
}
},
"transaction": {
"amount": {
"currency": "USD",
"total": "300"
},
"type": "1",
"mode": "1",
"items": [
{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500",
"shipping": "",
"url": ""
}
],
"shipping_address": {
"phone": {}
},
"invoice_number": "123455"
},
"custom": {},
"risk_check": true,
"three_d": {},
"create_time": "2023-06-09T18:07:37Z",
"subscriptions": null
}
# Response Body
# Status 200 Success
Parameter | Type | Description | Value |
---|---|---|---|
id | string | Identifier of the payment resource created | |
reference_id | string | In case of referenced payment (e.g., Capture or Refund), this fields included to see which payment was referenced | |
state | string | The state of the payment, authorization, or order transaction | - Authorised . The transaction was successfully authorised.- Pending . The transaction is currently pending.- Captured . The transaction has been captured.- Refunded . The transaction has been refunded.- Declined . The transaction has been declined.- Expired . The transaction has been expired.- Cancelled . The transaction has been cancelled.- Voided . The transaction has been voided.- Timeout . The transaction has been timeout.- Deferred Refund . The transaction refund has been deferred.- Flagged . The transaction has been flagged.- Deferred Capture . The transaction Capture has been deferred.- Card Verified . The card has been verified. |
result | object | Contain result of the payment request | |
intent | string | The payment intent | - sale . Makes an immediate payment.- auth . Authorizes a payment for capture later |
payer | object | Source of the funds for this payment represented by a direct credit card | |
payee | object | A resource representing a Payee who receives the funds and fulfills the order | |
transaction | object | Transactional details including the amount and item details | |
custom | object | Free-form field for the use of clients | |
create_time | datetime | Payment creation time as defined in RFC 3339 Section 5.6 | |
three_d | object | ThreeD Secure details pertaining to the transaction | |
delayed_capture_time | datetime | Payment capture time in case the capture is delayed. (as defined in RFC 3339 Section 5.6 | |
metadata | ArrayOf( KeyValuePair(string, string)) | contains additional information about the transaction |
# Error Response Body
# Status 400 Bad Request
Parameter | Type | Description |
---|---|---|
code | string | Code indentifying the error on our system |
name | string | Name indentifying the error on our system |
message | string | Message related to the error |
eventId | string | Unique Identifier for the request |
# Status 422 Unprocessable Entity
The request was well-formed but was unable to be follewed due to semantic errors.
Parameter | Type | Description |
---|---|---|
eventId | string | Unique Identifier for the request |
errors | arrayOf(error) | Array of errors |
# errors object
Parameter | Type | Description |
---|---|---|
code | string | Code indentifying the error on our system |
name | string | Name indentifying the error on our system |
message | string | Message related to the error |