Create a payment

Throughout this documentation, the terms "payment," "loan," and "order" are used interchangeably to refer to the same concept.

Environments

https://api.aplazo.net/api

Create a loan or payment

post

Initiates an Aplazo loan request or payment, generating a checkout URL for the merchant's customer.

Authorizations
Body
totalPricenumberRequired

Total price of the cart or order.

Example: 2600
shopIdstringRequired

Identifier for the merchant's shop.

Example: Prueba Tienda
cartIdstringRequired

Unique identifier for the shopping cart. Works as the merchant's external identifier.

Example: cart-id-321
successUrlstring · uriRequired

URL to redirect the customer upon successful payment.

Example: https://merchant-page.mx/Success_Aplazo/cartid1234.php
errorUrlstring · uriRequired

URL to redirect the customer upon payment failure.

Example: https://merchant-page.mx/Error_Aplazo.php
cartUrlstring · uriRequired

URL for the customer's cart.

Example: https://merchant-page.mx/Cart_Aplazo.php
webHookUrlstring · uriRequired

URL for webhook notifications related to the loan.

Example: https://merchant-page.mx/order/hook
Responses
200
Loan created successfully. Returns a checkout URL for the customer.
application/json
post
POST /loan HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 889

{
  "totalPrice": 2600,
  "shopId": "Prueba Tienda",
  "cartId": "cart-id-321",
  "successUrl": "https://merchant-page.mx/Success_Aplazo/cartid1234.php",
  "errorUrl": "https://merchant-page.mx/Error_Aplazo.php",
  "cartUrl": "https://merchant-page.mx/Cart_Aplazo.php",
  "webHookUrl": "https://merchant-page.mx/order/hook",
  "buyer": {
    "addressLine": "Fake Street 123",
    "email": "john@doe.com",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "5511113590",
    "postalCode": "99999"
  },
  "products": [
    {
      "id": "product-01",
      "count": 1,
      "description": "Leather sneakers Size 8.5",
      "imageUrl": "http://www.product-image.com/product-01",
      "price": 1800,
      "title": "Casual Sneakers"
    },
    {
      "id": "product-02",
      "count": 2,
      "description": "White Tshirt Size M",
      "imageUrl": "http://www.product-image.com/product-02",
      "price": 800,
      "title": "T-Shirt"
    }
  ],
  "discount": {
    "price": 20,
    "title": "Buen fin"
  },
  "shipping": {
    "price": 0,
    "title": "Envio Express"
  },
  "taxes": {
    "price": 0,
    "title": "IVA"
  }
}
{
  "url": "https://checkout.aplazo.net/main/ee58769d-ade7-469c-ac8f-eb9f89074e02",
  "loanId": "155345",
  "loanToken": "ee58769d-ade7-469c-ac8f-eb9f89074e02"
}

Response Examples

Success

200 - Successful Loan Creation
Response: 200 OK
{
  "url": "https://checkout.aplazo.net/main/1777a4f6-da5e-4787-9956-40467dd0c37e",
  "loanId": 156123,
  "loanToken": "1777a4f6-da5e-4787-9956-40467dd0c37e"
}

Errors

400 - An ACTIVO status loan with the same cartId already exists
Response: 400 Bad Request
{
    "status": 0,
    "error": "OUTSTANDING_LOAN_ALREADY_EXISTS",
    "message": "Outstanding loan with cartId: cart-id-321 already exists"
}
400 - Invalid data type
Response: 400 Bad Request
403 - Invalid Authentication token
Response: 403 Forbidden
500 - Missing field or parameter
Response: 500 Internal Server Error
{
    "timestamp": "2025-01-06T17:27:52.605+00:00",
    "status": 500,
    "error": "Internal Server Error",
    "path": "/api/loan"
}

Last updated

Was this helpful?