Orders
POST /orders/[playerId]/reservation
Creates a reservation for a product tied to a specific player and establishment. This can be used to hold inventory before full checkout or confirmation.
Endpoint
Request Body
{
"productId": "string" // required
"establishmentId": "string" // required
"email": "string"
"denomination": "integer"
"quantity": "integer"
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| productId | string | Sí | |
| establishmentId | string | Sí | |
| string | No | ||
| denomination | integer | No | |
| quantity | integer | No |
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí |
Responses
200
Reservation successfully created.
{
"operationId": "c51c4418-49a3-404f-b811-cfbb4e0a3619"
"orderType": "Reservation"
"orderStatus": "Pending"
"orderDisplayStatus": "Pending"
"value": "number"
"reference": "PROV-REF-000003"
"playerId": "29df8b26-a2c8-4a45-9601-07fec4c4242d"
"productId": "cd8ca7f8-550c-47cb-9563-e4d383aec965"
"playerEmail": "user@user.com"
"playerName": "user player"
"establishmentId": "522ef85f-7a5c-4ebb-b38d-46f40981be04"
"establishmentName": "User Establishment"
"establishmentImage": "/icon.png"
"establishmentThumbnailUrl": "/logo.png"
"transactionId": "6d5e3efe-f7ee-43ab-994e-372d80c56396"
"address": "string"
"country": "string"
"postalCode": "string"
"city": "string"
"date": "2025-04-11T12:42:39.469Z"
"trackToken": "381tq7qzj5k34kdowsicw8"
"trackUrl": "https://app.thepowerplugin.com/delivery?token=381tq7qzj5k34kdowsicw8&transactionId=6d5e3efe-f7ee-43ab-994e-372d80c56396"
}400
Invalid reservation payload.
500
Failed to reserve product.
PUT /orders/[playerId]/details/[transactionId]
Updates customer and billing details associated with an order transaction.
Endpoint
Request Body
{
"email": "string"
"address": "string"
"country": "string"
"postalCode": "string"
"city": "string"
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| string | No | Customer email address | |
| address | string | No | Street address |
| country | string | No | Country code or name |
| postalCode | string | No | Postal or ZIP code |
| city | string | No | City name |
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | Unique identifier of the player | string | path | Sí |
| transactionId | Unique identifier of the transaction | string | path | Sí |
Responses
200
Order details updated successfully
{
"success": "boolean"
"message": "string"
}400
Invalid request payload
404
Order or transaction not found
422
Validation error
500
Internal server error
DELETE /orders/[playerId]/reservation/[transactionId]
Cancels a previously created reservation by transaction ID. Frees up any reserved stock and removes pending entries.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí | |
| transactionId | string | path | Sí |
Responses
200
Reservation cancelled successfully.
400
Invalid cancellation request.
500
Server error while cancelling reservation.
POST /orders/[playerId]/send/[transactionId]
Confirms and processes the shipment of a reserved physical product. Requires address and recipient details to complete dispatch.
Endpoint
Request Body
{
"addressLine1": "string"
"country": "string"
"postalCode": "string"
"recipientName": "string"
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| addressLine1 | string | No | |
| country | string | No | |
| postalCode | string | No | |
| recipientName | string | No |
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí | |
| transactionId | string | path | Sí |
Responses
200
Shipping process confirmed.
400
Missing or invalid address information.
500
Error processing shipment.
POST /orders/[playerId]/track/[transactionId]
Registers a tracking number for a dispatched order. Used to update delivery status and notify the player.
Endpoint
Request Body
{
"trackingNumber": "string" // required
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| trackingNumber | string | Sí |
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí | |
| transactionId | string | path | Sí |
Responses
200
Tracking number saved successfully.
400
Invalid tracking data.
500
Failed to register tracking number.
POST /orders/[playerId]/acquisition/[transactionId]
Finalizes the acquisition of a reserved product by marking it as completed. This may trigger reward attribution, stock deduction, or analytics updates.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí | |
| transactionId | string | path | Sí |
Responses
200
Acquisition completed successfully.
400
Invalid acquisition request.
500
Server error during acquisition.
DELETE /orders/[playerId]/acquisition/[transactionId]
Cancels a product acquisition and optionally processes a refund. Useful in cases of duplicate redemptions, errors, or admin overrides.
Endpoint
Request Body
{
"refund": "boolean"
}| Atributo | Tipo | Requerido | Descripción |
|---|---|---|---|
| refund | boolean | No |
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí | |
| transactionId | string | path | Sí |
Responses
200
Acquisition cancelled successfully.
400
Invalid cancellation request.
500
Server error during cancellation.
GET /players/[playerId]/orders
Retrieves a list of orders (acquisitions, redemptions, reservations) associated with the player.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí |
Responses
200
Orders retrieved successfully.
400
Invalid player ID.
500
Server error while fetching orders.
GET /players/[playerId]/orders/[transactionId]
Retrieves the details of a specific transaction by transaction ID for a player. Useful for auditing, reprocessing, or reviewing delivery history.
Endpoint
Parameters
| Atributo | Descripcion | Tipo | Ubicación | Requerido |
|---|---|---|---|---|
| playerId | string | path | Sí | |
| transactionId | string | path | Sí |
Responses
200
Transaction details retrieved.
500
Failed to retrieve transaction.