Skip to main content

Accept Payments

With this API, you can integrate a billing system into your platform, facilitating one-time payments and refunds.


Features​

Authentication and Security

To access the API, it is necessary to authenticate each request using a token, see Authentication.

πŸ“Œ Generate a charge for a customer.​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: POST
  • Endpoint: /api/v3/Charges
  • Description: Create charge.
  • Required headers:
  • Content-Type: application/json
  • Authorization: Bearer {your_token}
  • Example:
{
"customer": {
"id": "customer114",
"name": "Carlos DΓΊran",
"email": "[email protected]",
"phoneNumber": "+50364331900"
},
"order": {
"id": "EPAY001",
"amount": 200.9,
"description": "Estufa elΓ©ctrica G.E modelo JJCBS631SFSS",
"name": "Compra de cocina"
},
"cardId": "69167196381d34f25eb22e9d",
"authenticationId": null,
"billingInfo": {
"countryCode": "US",
"stateCode": "CA",
"zipCode": "10002"
},
"locationCode": "N1C0CD001"
}
Create payment methods

You will need test card data β†’, this documentation guides you through valid test scenarios for the sandbox environment.

Before making a charge, you must create a payment method β†’. After creating the payment method, the ID must be used in the cardId (Required) field.

- Request Parameters​

ParameterTypeRequiredDescription
customerobjectβœ…Customer information
customer.idstring❌Unique customer identifier
customer.namestringβœ…Customer's full name
customer.emailstringβœ…Customer's email
customer.phoneNumberstring❌Phone number with country code
orderobjectβœ…Order information
order.idstringβœ…Unique order identifier
order.amountdecimalβœ…Amount to charge
order.descriptionstring❌Order description
order.namestringβœ…Order name
cardIdstringβœ…ID of the token returned during tokenization
authenticationIdstring❌3DS authentication ID (null on first request)
billingInfoobjectConditional*Billing information, can be null
billingInfo.countryCodestringConditional*Country code
billingInfo.stateCodestringConditional*State code
billingInfo.zipCodestringConditional*Zip code
locationCodestringβœ…Branch code, obtained from Portal β†’ Configuration β†’ Branches β†’ Edit β†’ below the Phone field
Billing Info

The billingInfo object is required only when the card's issuing country is USA or CAN. You can determine this from the country code of the payment method's BIN.

Location Code

You can find the locationCode in the portal when editing your branch, right below the phone number. Do not confuse with locationId.

- Response Parameters​

ParameterTypeDescription
statusstringCharge status (FAILED, SUCCEEDED, AUTHENTICATION_REQUIRED)
messagestringDescription of the result
errorobjectError code and message (when applicable)
authenticationobject3DS authentication URL and ID (when applicable)
orderobjectObject containing the purchase order information
createdAtobjectPayment creation date

- States​

1. FAILED​

The payment process has failed. The error node will contain the details.

Details
View response example
{
"status": "FAILED",
"message": "The payment could not be processed: We need more validations, please contact customer service at +50324086126. Id: 1b44231a-1cfc-424d-9573-0a3a3ff756bd",
"error": {
"code": "FRAUD_PREVENT",
"message": "We need more validations, please contact customer service at +50324086126",
"title": "Transaction Error",
"detail": "We need more validations, please contact customer service at +50324086126"
},
"authentication": null,
"order": null,
"createdAt": "2025-12-04T17:51:59.1548011Z"
}

2. SUCCEEDED​

The payment process was completed successfully.

Details
View response example
{
"status": "SUCCEEDED",
"message": "The payment was made successfully",
"error": null,
"authentication": null,
"order": {
"id": "50582",
"reference": "EPAY001",
"amount": 200.9,
"captureAmount": 200.9,
"currency": "USD",
"authorizationCode": "217982"
},
"createdAt": "2025-12-04T17:51:59.1548011Z"
}

3. AUTHENTICATION_REQUIRED​

If the status is AUTHENTICATION_REQUIRED, the API will return an authentication URL. You must guide the user through this flow (in this case, using an iframe is necessary).

3DS Authentication Guide

For a detailed guide on how to implement the iframe and handle the 3DS flow, see our 3D Secure Authentication documentation.

Details
View response example
{
"status": "AUTHENTICATION_REQUIRED",
"message": "Payment requires 3DS authentication",
"error": null,
"authentication": {
"url": "https://front-3ds.h4b.dev/authentication/9b77e558-7d5d-4fdd-b84c-f295225ba2e1?showBranding=True&lang=es",
"id": "9b77e558-7d5d-4fdd-b84c-f295225ba2e1"
},
"order": null,
"createdAt": "2025-12-04T17:51:59.1548011Z"
}

πŸ“Œ Generate a charge refund​

  • Base URL: https://api-sandbox.n1co.shop
  • Method: POST
  • Endpoint: /api/v3/Refunds
  • Description: Create refund.
  • Required headers:
  • Content-Type: application/json
  • Authorization: Bearer {your_token}
  • Response example:
{
"orderId": "50634",
"cancellationReason": "Product in poor condition was returned by the customer"
}