Orders

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

POST/orders/{playerId}/reservation

Request Body

{
  "productId": "00000000-0000-0000-0000-000000000000",
  "establishmentId": "00000000-0000-0000-0000-000000000000",
  "email": "name@example.com",
  "denomination": 0
}
AttributeTypeRequiredDescription
productIdstring(uuid)Yes
establishmentIdstring(uuid)Yes
emailstring(email)No
denominationintegerNo

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes

Responses

200

Reservation successfully created.

{
  "operationId": "c51c4418-49a3-404f-b811-cfbb4e0a3619",
  "orderType": "Reservation",
  "orderStatus": "Pending",
  "orderDisplayStatus": "Pending",
  "value": 0,
  "reference": "PROV-REF-000003",
  "playerId": "29df8b26-a2c8-4a45-9601-07fec4c4242d",
  "productId": "cd8ca7f8-550c-47cb-9563-e4d383aec965",
  "playerEmail": "user@user.com",
  "firstName": "John",
  "lastName": "Doe",
  "establishmentId": "522ef85f-7a5c-4ebb-b38d-46f40981be04",
  "establishmentName": "User Establishment",
  "establishmentImage": "/icon.png",
  "establishmentThumbnailUrl": "/logo.png",
  "transactionId": "6d5e3efe-f7ee-43ab-994e-372d80c56396",
  "address": null,
  "country": null,
  "postalCode": null,
  "city": null,
  "province": null,
  "date": "2025-04-11T12:42:39.469Z",
  "trackToken": "381tq7qzj5k34kdowsicw8",
  "trackUrl": "https://app.thepowerplugin.com/delivery?token=381tq7qzj5k34kdowsicw8&transactionId=6d5e3efe-f7ee-43ab-994e-372d80c56396"
}
AttributeTypeRequiredDescription
operationIdstring(uuid)Yes
orderTypestringYes
orderStatusstringYes
orderDisplayStatusstringYes
valuenumberYes
referencestringYes
playerIdstring(uuid)Yes
productIdstring(uuid)Yes
playerEmailstring(email)Yes
firstNamestringYes
lastNamestringYes
establishmentIdstring(uuid)Yes
establishmentNamestringYes
establishmentImagestringYes
establishmentThumbnailUrlstringYes
transactionIdstring(uuid)Yes
addressstringYes
countrystringYes
postalCodestringYes
citystringYes
provincestringYes
datestring(date-time)Yes
trackTokenstringYes
trackUrlstring(uri)Yes

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

PUT/orders/{playerId}/details/{transactionId}

Request Body

{
  "email": "string",
  "address": "string",
  "country": "string",
  "postalCode": "string",
  "city": "string"
}
AttributeTypeRequiredDescription
emailstringNoCustomer email address
addressstringNoStreet address
countrystringNoCountry code or name
postalCodestringNoPostal or ZIP code
citystringNoCity name

Parameters

AttributeDescriptionTypeLocationRequired
playerIdUnique identifier of the playerstringpathYes
transactionIdUnique identifier of the transactionstringpathYes

Responses

200

Order details updated successfully

{
  "success": false,
  "message": "string"
}
AttributeTypeRequiredDescription
successbooleanNo
messagestringNo

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

DELETE/orders/{playerId}/reservation/{transactionId}

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes
transactionIdstringpathYes

Responses

200

Reservation cancelled successfully.

400

Invalid cancellation request.

500

Server error while cancelling reservation.

POST /orders/[playerId]/send/[transactionId]

Captures delivery details for an existing reservation and keeps the order in the Reservation / Pending state. If shipping details were already captured, repeated calls are idempotent and do not decrement product stock again.

Endpoint

POST/orders/{playerId}/send/{transactionId}

Request Body

{
  "firstName": "string",
  "lastName": "string",
  "addressLine1": "string",
  "addressLine2": "string",
  "city": "string",
  "province": "string",
  "country": "string",
  "postalCode": "string",
  "email": "name@example.com"
}
AttributeTypeRequiredDescription
firstNamestringNoOverrides the recipient first name stored on the reservation.
lastNamestringNoOverrides the recipient last name stored on the reservation.
addressLine1stringNoOverrides the primary address line stored on the reservation.
addressLine2stringNoOverrides the secondary address line stored on the reservation.
citystringNoOverrides the destination city stored on the reservation.
provincestringNoOverrides the destination province stored on the reservation.
countrystringNoOverrides the destination country stored on the reservation.
postalCodestringNoOverrides the postal code stored on the reservation.
emailstring(email)NoOverrides the recipient email stored on the reservation.

Parameters

AttributeDescriptionTypeLocationRequired
playerIdPlayer identifier that owns the reservation.stringpathYes
transactionIdReservation transaction identifier.string(uuid)pathYes

Responses

200

Reservation delivery details captured successfully.

{
  "operationId": "reservation-op-1",
  "transactionId": "11111111-1111-1111-1111-111111111111",
  "orderType": "Reservation",
  "orderStatus": "Pending",
  "orderDisplayStatus": "Pending",
  "playerId": "player-1",
  "productId": "product-1",
  "establishmentId": "est-1",
  "value": 100,
  "playerName": "John Doe",
  "playerEmail": "john@example.com",
  "address": {
    "firstName": "John",
    "lastName": "Doe",
    "addressLine1": "Main St 1",
    "addressLine2": "Apt 3",
    "city": "Los Angeles",
    "province": "CA",
    "country": "US",
    "postalCode": "90210",
    "email": "john@example.com"
  },
  "deliveryDetailsCapturedAt": "2026-03-24T00:00:00.000Z"
}
AttributeTypeRequiredDescription
operationIdstringYes
transactionIdstring(uuid)Yes
orderTypestringYes
orderStatusstringYes
orderDisplayStatusstringYes
playerIdstringYes
productIdstringYes
establishmentIdstringYes
valuenumberYes
playerNamestringNo
playerEmailstring(email)No
addressobjectYes
address.firstNamestringYes
address.lastNamestringYes
address.addressLine1stringYes
address.addressLine2stringYes
address.citystringYes
address.provincestringYes
address.countrystringYes
address.postalCodestringYes
address.emailstring(email)Yes
deliveryDetailsCapturedAtstring(date-time)Yes

400

Invalid reservation state, or product stock cannot be decremented.

{
  "message": "Invalid operation or record status/type"
}
AttributeTypeRequiredDescription
messagestringNo

404

Transaction not found.

{
  "message": "Transaction not found"
}
AttributeTypeRequiredDescription
messagestringNo

422

Validation error for path or body fields.

{
  "example_key": [
    "string"
  ]
}
AttributeTypeRequiredDescription
{key}array<string>No
{key}[]stringNo

500

Unexpected server error while updating product stock.

{
  "message": "Failed to update poduct stock"
}
AttributeTypeRequiredDescription
messagestringNo

POST /orders/[playerId]/track/[transactionId]

Registers a tracking number for a dispatched order. Used to update delivery status and notify the player.

Endpoint

POST/orders/{playerId}/track/{transactionId}

Request Body

{
  "trackingNumber": "string"
}
AttributeTypeRequiredDescription
trackingNumberstringYes

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes
transactionIdstringpathYes

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

POST/orders/{playerId}/acquisition/{transactionId}

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes
transactionIdstringpathYes

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

DELETE/orders/{playerId}/acquisition/{transactionId}

Request Body

{
  "refund": false
}
AttributeTypeRequiredDescription
refundbooleanNo

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes
transactionIdstringpathYes

Responses

200

Acquisition cancelled successfully.

400

Invalid cancellation request.

500

Server error during cancellation.

POST /orders/list

Retrieves a paginated list of orders associated with the authenticated establishment, including search and filters.

Endpoint

POST/orders/list

Request Body

{
  "search": "string",
  "filters": {
    "status": [
      "string"
    ],
    "price": {
      "min": 0,
      "max": 0
    }
  },
  "pagination": {
    "page": 1,
    "limit": 25
  }
}
AttributeTypeRequiredDescription
searchstringNoSearch by transactionId and, for search strings with at least 3 characters, by product name through product search.
filtersobjectNo
filters.statusarray<string>No
filters.status[]stringNo
filters.priceobjectNo
filters.price.minnumberNo
filters.price.maxnumberNo
paginationobjectNo
pagination.pageintegerNo
pagination.limitintegerNo

Responses

200

Orders retrieved successfully.

{
  "envelope": {
    "type": "string",
    "dataPath": "string"
  },
  "meta": {
    "pagination": {
      "total": 0,
      "page": 0,
      "limit": 0,
      "hasMore": false
    },
    "filters": {},
    "sort": {},
    "paginationControls": {}
  },
  "items": [
    {
      "operationId": "string",
      "playerId": "string",
      "establishmentId": "string",
      "orderStatus": "string",
      "orderType": "string",
      "date": "2026-01-01T00:00:00.000Z"
    }
  ]
}
AttributeTypeRequiredDescription
envelopeobjectNo
envelope.typestringNo
envelope.dataPathstringNo
metaobjectNo
meta.paginationobjectNo
meta.pagination.totalintegerNo
meta.pagination.pageintegerNo
meta.pagination.limitintegerNo
meta.pagination.hasMorebooleanNo
meta.filtersobjectNo
meta.sortobjectNo
meta.paginationControlsobjectNo
itemsarray<object>No
items[]objectNo
items[].operationIdstringNo
items[].playerIdstringNo
items[].establishmentIdstringNo
items[].orderStatusstringNo
items[].orderTypestringNo
items[].datestring(date-time)No

400

Invalid query or request format.

500

Server error while retrieving orders.

GET /players/[playerId]/orders

Retrieves a list of orders (acquisitions, redemptions, reservations) associated with the player.

Endpoint

GET/players/{playerId}/orders

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes

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

GET/players/{playerId}/orders/{transactionId}

Parameters

AttributeDescriptionTypeLocationRequired
playerIdstringpathYes
transactionIdstringpathYes

Responses

200

Transaction details retrieved.

500

Failed to retrieve transaction.