post https://sandbox.ecartpay.com/api/checkouts
The HTTP POST request to the specified URL is used to create checkouts in the ecartpay system. The request should include the customer details, currency, amounts, concept, and other relevant information. Upon successful execution, the API returns a status code of 200 along with checkout details including account_id, items, token, public_id, link, and timestamps.
Request Body
customer_id
(string) optional: The ID of the customer.title
(string): Title of the checkout.subtitle
(string): Subtitle of the checkout.image_url
(string): URL of the image associated with the checkout.currency
(string): Currency for the transaction.amounts
(array of numbers): Array of amounts.concept
(string): Description of the checkout concept.notify_url
(string): URL for receiving notifications.reference_id
(string): Reference ID for the checkout.reference
(string): Reference for the checkout.
Response
account_id
(string): ID of the account associated with the checkout.title
(string): Title of the checkout.subtitle
(string): Subtitle of the checkout.image_url
(string): URL of the image associated with the checkout.currency
(string): Currency for the transaction.amounts
(array of numbers): Array of amounts.concept
(string): Description of the checkout concept.items
(array of objects): Details of the items included in the checkout.name
(string): Name of the item.quantity
(number): Quantity of the item.price
(number): Price of the item.discount
(number): Discount on the item.is_service
(boolean): Indicates if the item is a service.id
(string): ID of the item.
customer_id
(string): ID of the customer.notify_url
(string): URL for receiving notifications.reference_id
(string): Reference ID for the checkout.reference
(string): Reference for the checkout.token
(string): Token associated with the checkout.public_id
(string): Public ID of the checkout.link
(string): Link to the checkout.id
(string): ID of the checkout.created_at
(string): Timestamp indicating the creation time.updated_at
(string): Timestamp indicating the last update time.
Example Response
{
"account_id": "5d2d436e3199ae000449065b",
"title": "Ecart Pay",
"subtitle": "The best payment solution",
"image_url": "https://miimage.com/image.jpg",
"currency": "MXN",
"amounts": [
100,
200,
500,
1000,
1500,
3000
],
"concept": "Recharge",
"items": [
{
"name": "Recharge",
"quantity": 1,
"price": 100,
"discount": 0,
"is_service": false,
"id": "65b011ba7f9f322421087221"
}
],
"customer_id": "65aff37afebdf2a42f88c178",
"notify_url": "https://example.com/webhooks/checkout?user_id=1",
"reference_id": "001",
"reference": "Custom recharge",
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxODliZTgwZGYyOTE1OTgyMjFhNWU5NSIsInNjb3BlcyI6WyJ3cml0ZV9jaGVja291dHMiXSwiaWF0IjoxNzA2MDM3NjkwLCJleHAiOjE3MDYwMzg1OTAsImF1ZCI6Imh0dHBzOi8vc2FuZGJveC5lY2FydHBheS5jb20iLCJzdWIiOiJjaGVja291dHMifQ.nZHFH-4diuddAAp8hrUrg7hI0Jzti330zlAIPUz6_AB4g6KSIpJWIEL-HVxk8JPGuq6eBVj80Ji7l6cUmOqofQ",
"public_id": "pub6189be80df291598221a5e93",
"link": "https://sandbox.ecartpay.com/v2/checkout?id=65b011ba7f9f32242108721f",
"id": "65b011ba7f9f32242108721f",
"created_at": "2024-01-23T19:21:30.912Z",
"updated_at": "2024-01-23T19:21:30.912Z"
}