Create an Order
Generate a payment request on the 88 Pay platform and receive a unique hash as a response. This hash will be included in the body of a subsequent endpoint request to complete the transaction.
How to Generate the Order?
Request Details
- Method:
Post
- URL:
https://b61cr11gvd.execute-api.us-east-1.amazonaws.com/v1/api/payment/create
Headers
Include the following headers in your request:
"Authorization": "token" // Generated token for API authorization
Request Body
The request payload should be structured as follows:
Field | Type | Description |
---|---|---|
country | string | ISO 3166-1 alpha-3 country code (e.g., COL for Colombia, USA for the United States). |
origin | string | Origin of the request, must be set to api . |
amount | string | Total amount to be paid, represented as a whole number without decimals (e.g., 1000 ). |
email | string | Customer's email address |
Sample Request
{
"country": "COL",
"origin": "api",
"amount": "1000",
"email": "test@gmail.com"
}
Sample Response
202 Accepted Payment Created
{
"status": {
"code": 202,
"message": "success",
"kind": "unknown"
},
"data": {
"hash": "U2FsdGV....__hash-payment"
}
}
422 Unprocessable Entity
The body sent is not correct
{
"status": {
"code": 422,
"message": "[\n {\n \"code\": \"invalid_type\",\n \"expected\": \"string\",\n \"received\": \"undefined\",\n \"path\": [\n \"amount\"\n ],\n \"message\": \"amount is required\"\n }\n]",
"kind": "validation"
}
}
401 Unauthorized Header
Token was not sent
{
"status": {
"code": "token/not-found",
"kind": "client",
"name": "TokenNotFoundError"
}
}
401 Unauthorized Token (Malformation)
The token sent is incorrect or expired.
{
"status": {
"code": "security/unauthorized-error",
"kind": "client",
"name": "UnauthorizedError"
}
}
Token Expiration
The API requires an authorization token to validate requests. Keep in mind that:
- Tokens expire 1 hour after being generated