Skip to main content
POST
/
v1
/
receipts
/
{orderNumber}
/
redeem
Redeem Receipt
curl --request POST \
  --url https://api.monime.io/v1/receipts/{orderNumber}/redeem \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'Monime-Space-Id: <monime-space-id>' \
  --data '
{
  "redeemAll": true,
  "entitlements": [
    {
      "key": "<string>",
      "units": 1
    }
  ],
  "metadata": {}
}
'
import requests

url = "https://api.monime.io/v1/receipts/{orderNumber}/redeem"

payload = {
    "redeemAll": True,
    "entitlements": [
        {
            "key": "<string>",
            "units": 1
        }
    ],
    "metadata": {}
}
headers = {
    "Idempotency-Key": "<idempotency-key>",
    "Monime-Space-Id": "<monime-space-id>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<idempotency-key>',
    'Monime-Space-Id': '<monime-space-id>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({redeemAll: true, entitlements: [{key: '<string>', units: 1}], metadata: {}})
};

fetch('https://api.monime.io/v1/receipts/{orderNumber}/redeem', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.monime.io/v1/receipts/{orderNumber}/redeem",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'redeemAll' => true,
    'entitlements' => [
        [
                'key' => '<string>',
                'units' => 1
        ]
    ],
    'metadata' => [
        
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "Idempotency-Key: <idempotency-key>",
    "Monime-Space-Id: <monime-space-id>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.monime.io/v1/receipts/{orderNumber}/redeem"

	payload := strings.NewReader("{\n  \"redeemAll\": true,\n  \"entitlements\": [\n    {\n      \"key\": \"<string>\",\n      \"units\": 1\n    }\n  ],\n  \"metadata\": {}\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "<idempotency-key>")
	req.Header.Add("Monime-Space-Id", "<monime-space-id>")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.monime.io/v1/receipts/{orderNumber}/redeem")
  .header("Idempotency-Key", "<idempotency-key>")
  .header("Monime-Space-Id", "<monime-space-id>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"redeemAll\": true,\n  \"entitlements\": [\n    {\n      \"key\": \"<string>\",\n      \"units\": 1\n    }\n  ],\n  \"metadata\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.monime.io/v1/receipts/{orderNumber}/redeem")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Monime-Space-Id"] = '<monime-space-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"redeemAll\": true,\n  \"entitlements\": [\n    {\n      \"key\": \"<string>\",\n      \"units\": 1\n    }\n  ],\n  \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "messages": [
    "<unknown>"
  ],
  "result": {
    "redeem": true,
    "receipt": {
      "orderName": "<string>",
      "orderNumber": "<string>",
      "orderAmount": {
        "currency": "<string>",
        "value": 123
      },
      "createTime": "2023-11-07T05:31:56Z",
      "updateTime": "2023-11-07T05:31:56Z",
      "entitlements": [
        {
          "key": "<string>",
          "name": "<string>",
          "limit": 1,
          "current": 1,
          "remaining": 1,
          "exhausted": true
        }
      ],
      "metadata": {}
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication specified with the header Authorization: Bearer <access_token>

Headers

Idempotency-Key
string
required

This header is used to uniquely identify a logical request, ensuring that it is not processed more than once during retries.

Maximum string length: 64
Monime-Version
enum<string> | null

Specifies which version of the Monime API will handle this request.

Available options:
caph.2025-08-23,
caph.2025-06-20
Monime-Space-Id
string
required

The value is the tenancy parameter that Monime uses to determine which space the request is intended for.

Maximum string length: 64
Pattern: ^spc-.*$

Path Parameters

orderNumber
string
required

The order number of the receipt to be redeemed.

Maximum string length: 20

Body

application/json

Redeem one or more entitlements from a receipt. When processing a bulk redemption, if any entitlement is already exhausted, the entire operation is rejected.

redeemAll
boolean | null

Whether to redeem all entitlements in the receipt.

entitlements
object[] | null

List of entitlements to redeem. When set, it takes precedence over the 'redeemAll' flag.

metadata
object | null

Optional metadata for attaching context or tracking info.

Response

200 - application/json

OK

success
boolean

Represents the status of the query operation, confirming if it was successful. This field is always true

messages
any[]

Contains a list of messages providing relevant information or feedback related to the query or operation

result
Redemption Result · object

Represents the outcome of redeeming entitlement(s) from a receipt.