Logo PopinaPopina API

Create an order

Create an order in the loyalty system. Use this end point to register a purchase made by a customer in the loyalty system. It returns the externalOrderId. The purchase will be created with the status "final" or "closed", depending of the loyalty service. An order is automatically created when the endpoint /customers/apply is called.

POST/v1/orders/
authorization<token>

To get an API key, please contact us. We'll be happy to help you.

In: header

customerIdstring

Customer id

Formatuuid
orderIdstring

Order id

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:4010/v1/orders/" \  -H "Content-Type: application/json" \  -d '{    "customerId": "customerId",    "orderId": "2b630af8-d94f-4db9-a203-795338461ce8"  }'
{
  "externalOrderId": "loyalty_order_123456"
}
{
  "code": "CUSTOMER_NOT_FOUND",
  "message": "Customer not found."
}
{
  "code": "ORDER_ALREADY_PROCESSED",
  "message": "Loyalty order already processed."
}
{
  "code": "ORDER_DATA_PARSING_ERROR",
  "message": "Loyalty order data parsing error."
}
{
  "code": "UNEXPECTED_ERROR",
  "message": "Failed to create order"
}