Logo PopinaPopina API

Pay order with balance

Pay order using customer balance. Creates a pending movement that will be finalized when order is received from POS. Location is extracted from device token.

POST/v1/customers/{customerId}/purchase
authorization<token>

Use device JWT token

In: header

Path Parameters

customerIdstring

Customer UUID

Formatuuid
amountinteger

Amount in cents

Range0 < value
description?string|null
operatorId?string|null
paymentRowIdstring

Payment row UUID

Formatuuid

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:4012/v1/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/purchase" \  -H "Content-Type: application/json" \  -d '{    "amount": 2500,    "description": "Purchase order",    "operatorId": "c7d6e5f4-3b2a-4c9d-8e7f-6a5b4c3d2e1f",    "paymentRowId": "d8e7f6a5-4c3b-4d1e-9f8a-7b6c5d4e3f2a"  }'
{
  "id": "a6b5c4d3-2e1f-4a9b-8c7d-6e5f4a3b2c1d",
  "type": "purchase",
  "amount": -2500,
  "updatedBalance": -1000,
  "totalOrder": 2500,
  "description": null,
  "status": "pending",
  "currencyCode": "EUR",
  "createdAt": "2025-10-28T13:30:00.000Z",
  "updatedAt": "2025-10-28T13:30:00.000Z"
}
{
  "message": "Insufficient balance for purchase",
  "code": "INSUFFICIENT_BALANCE"
}
{
  "message": "Insufficient balance for purchase",
  "code": "INSUFFICIENT_BALANCE"
}