KaiPay’s API will allow you to connect you e-commerce to multiple PSP and create custom workflows with multiple third party tools.
To authenticate, add an Authorization
header to your API request that contains an API Key.
KaiPay’s API supports the use of API Keys. API Keys allow you to use another method of authentication separate from your account username and password. API Keys add an additional layer of security to your account and can be assigned specific permissions to limit which areas of your account they may be used to access.
You can request your API Key with the KaiPay Integrations team. To use keys, you must set a plain text header named “Authorization” with the contents of the header is “Bearer XXX” where XXX is your API Secret Key.
POST <https://api.kaipay.com/v1/client-session> HTTP/1.1
Authorization: Bearer Your.API.Key-HERE
curl -X "POST" "<https://api.kaipay.com/v1/client-session>" -H "Authorization: Bearer Your.API.Key-HERE" -H "Content-Type: application/json"
Base url: https://kaipay.com/v1
The Client Session endpoint allows you to create a checkout page for a specific order. You can use this as your complete hosted checkout solution or only to collect payment. To configure the checkout please navigate to the Checkout section in KaiPay’s web platform.
Field | Options | Required | |||
---|---|---|---|---|---|
metadata | Array | Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. | False | ||
currency | ISO Currency Catalog as String | Three-letter ISO currency code, in lowercase. | True | ||
success_redirect_url | URL | URL, where the user is redirected, if the payment status = success. | False | ||
customer | True | ||||
name | String | The customer’s full name. | True | ||
String | The customer’s email. | True | |||
shipping_address | False | ||||
name | string | Shipping receiver full name | True | ||
address_line_1 | string | Shipping address | True | ||
city | string | Shipping city | True | ||
state | string | Shipping state | True | ||
country | ISO Country Abbreviation Catalog (Alpha 2 Code) | Country (ISO Country Abbreviation Alpha 2 Code) | True | ||
int_number | string | Interior number of building/house/office | False | ||
ext_number | string | Exterior number of building/house/office | False | ||
reference | strings (max 25 characters) | Extra references to get to the address (Max. 25 characters) | False | ||
postal_code | string | Postal code of shipping address. If this value is provided, it won’t be required for credit/debit card payments. | True | ||
amount | Positive Integer | Amount intended to be collected by this payment. A positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). | True | ||
order | True | ||||
country | ISO Country Abbreviation Catalog (Alpha 2 Code) | Two-letter ISO country code, in lowercase. | True | ||
shipping_amount | Positive Integer | Amount intended to be collected by this payment in shipping fees. A positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g. a value of 99999999 for a USD charge of $999,999.99). |
This amount should already be included in amount
and will only serve the purpose to inform the user on how much the shipping cost is. | False |
| | line_items | | | | False |
| | | item_id | String | The ID for the item included in this client session, if any. | False |
| | | description | String | The description for the item included in this client session, if any. | True |
| | | amount | Positive Integer | The amount for the item included in this client session, if any. | True |
| | | quantity | Positive Integer | The quantity for the item included in this client session, if any. | True |
| | fees | | Array | Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about fees applied in the amount. The value for each key must be a positive integer. | False |
{
"metadata": {},
"currency": "MXN",
"success_redirect_url": "<https://kaipay.com>",
"customer": {
"name": "Juan Pérez",
"email": "[email protected]",
"shipping_address": {
"name": "Juan Perez",
"address_line_1": "Calle Prueba #1",
"city": "San Pedro Garza García",
"state": "NL",
"country": "MX",
"postal_code": "00000"
}
},
"amount": 21000,
"order": {
"country": "MX",
"shipping_amount": 100,
"line_items": [
{
"item_id": 1,
"description": "First item",
"amount": 10000,
"quantity": 1
},
{
"item_id": 2,
"description": "Second item",
"amount": 11000,
"quantity": 1
}
],
"fees": []
}
}
Field | ||
---|---|---|
id | ||
organization | ||
customer | ||
id | ||
billing_address | ||
shipping_address | ||
name | ||
mobile | ||
tax_id | ||
national_document_id | ||
order | ||
id | ||
line_items | ||
id | ||
item_id | ||
description | ||
amount | ||
discount_amount | ||
quantity | ||
tax_amount | ||
tax_code | ||
order | ||
fees | ||
shipping_amount | ||
country | ||
client_session_url | ||
amount | ||
metadata | ||
expiration_date | ||
success_redirect_url | ||
failure_redirect_url | ||
created_at | ||
updated_at | ||
currency |