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 PΓ©rez",
"email": "[email protected]",
"phoneNumber": "+50370000000"
},
"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 (recommended)
customer.idstring❌Unique customer identifier
customer.namestring❌Customer's full name (max. 255)
customer.emailstring❌Customer's email; must be valid if sent (max. 255)
customer.phoneNumberstring❌Phone number with country code
orderobjectβœ…Order information
order.idstringβœ…Unique order identifier
order.amountdecimalConditionalAmount to charge, greater than 0. Required when order.lineItems is not sent; must be omitted when it is
order.lineItemsarrayConditionalOrder items. Required when order.amount is not sent; must be omitted when it is. Repeated SKUs are not allowed
order.lineItems[].skustringConditionalSKU of a product in your catalog; it must exist in your store. Required when product is not sent
order.lineItems[].quantityintegerβœ…Quantity, greater than 0
order.lineItems[].productobjectConditionalProduct described in the request, to charge for something that is not in your catalog
order.lineItems[].product.namestringConditionalProduct name. Required when product is sent
order.lineItems[].product.pricedecimalConditionalUnit price, greater than 0. Required when product is sent
order.lineItems[].product.descriptionstring❌Product description
order.lineItems[].product.imageUrlstring❌Product image URL (max. 512)
order.descriptionstring❌Order description
order.namestringβœ…Order name (max. 150)
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. If omitted, the active branch marked as default is used. 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-sandbox.n1co.com/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"
}