Use /orders endpoint to create an order.

Orders are used to handle customers' payments of previously defined offers. Orders expire after 24 hours unless the payment is captured. Payment method is required in order entity for payment but can be added in update order and fetch in /payment-methods.

AUTHORIZATION Authorization with <glossary:JWT> is required.

post/orders

Request

  • Base URL
    https://mediastoreapi-sandbox.cleeng.com
  • URL
    https://mediastoreapi-sandbox.cleeng.com/orders
  • Auth
    API key in header Authorization

Request body

offerIdstring required

ID of Cleeng offer, e.g. A123123123_US

customerIdstring required

Customer identifier at Cleeng

countrystring required

2-letter customer country code (ISO 3166 country code - without 'UK'). It is the country code of the country where purchase is made.

currencystring required

Customer currency. To fetch customer's country and currency use /locales. A list of supported values can be found HERE

customerIPstring required

IP address of customer current location. Required conditionally when country and currency not given

paymentMethodIdinteger

Identifier of selected payment method. Publisher payment methods Ids are provided by Cleeng

couponCodestring

Coupon code applied for this order

buyAsAGiftboolean

Whether an order refers to gift purchase.

Response

200

Example response

{
  "responseData": {
    "success": true,
    "message": "Order created successfully",
    "order": {
      "id": 434946589,
      "customerId": 996028494,
      "customer": {
        "locale": "pl_PL",
        "email": "example@cleeng.com"
      },
      "publisherId": 120355559,
      "offerId": "S567921766_NL",
      "offer": {
        "title": "Monthly subscription (recurring) to customerName",
        "price": 18.3636,
        "currency": "EUR"
      },
      "totalPrice": 22.58,
      "priceBreakdown": {
        "offerPrice": 18.36,
        "discountedPrice": 18.36,
        "taxValue": 4.22
      },
      "taxRate": 0.23,
      "currency": "EUR",
      "country": "PL",
      "expirationDate": 1580307560,
      "requiredPaymentDetails": true
    }
  }
}

Changes

    • breaking

      the request property became required

    • breaking

      the request property type changed from integer to string, and format from int32 to no format

    • warning

      deleted the header request parameter Content-Type

    • warning

      deleted the header request parameter X-Publisher-Token

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      api operation id create-an-order removed and replaced with create-order

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status