---
title: "Subscriptions | Docs | Self-Checkout by R&D Copilot"
description: "Register the HTTPS endpoint that receives events, and read, retry and replay the deliveries."
canonical: "https://checkout.rdcopilot.com/docs/api-reference/subscriptions/"
language: en
updated: 2026-11-22
---

# Subscriptions

Register the HTTPS endpoint that receives events, and read, retry and replay the deliveries.

## List subscriptions

GET `/selfcheckout/v1/subscriptions`

Returns the subscriptions of your account with the state of their endpoint.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `limit` | query | `integer` | Nooptional | Records per page, from 1 to 500. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | The `nextCursor` of the previous page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of subscriptions. | `SubscriptionPage` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/selfcheckout/v1/subscriptions?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/subscriptions?limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/subscriptions?limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/subscriptions?limit=20');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/subscriptions?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "items": [
    {
      "id": "d71cb517-268f-4cd6-b28e-746d2fa7daf8",
      "url": "https://events.brumar.example/selfcheckout/events",
      "eventTypes": [
        "com.rdcopilot.selfcheckout.basket.completed.v1",
        "com.rdcopilot.selfcheckout.intervention.raised.v1",
        "com.rdcopilot.selfcheckout.intervention.resolved.v1",
        "com.rdcopilot.selfcheckout.device.faulted.v1",
        "com.rdcopilot.selfcheckout.rollout.completed.v1"
      ],
      "status": "failing",
      "http": 503,
      "revision": 1
    }
  ],
  "nextCursor": null
}
```

## Create a subscription

POST `/selfcheckout/v1/subscriptions`

Registers your HTTPS endpoint and the event types you want. Every delivery is signed with the secret of the subscription, which the answer returns once.

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `url` | `string` | Yesrequired | An HTTPS endpoint of yours. |
| `eventTypes` | `string[]` | Yesrequired | The event types you want. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The subscription was created. The body is the operation result with the signing secret, returned only here, once. | `SubscriptionOperationResult` |
| `400` | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. | `Error` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `409` | The `operationId` was already used with a different request. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/subscriptions" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "8e655896-91cf-41d3-a9a8-e85ccf0142f3",
  "url": "https://events.brumar.example/selfcheckout/events",
  "eventTypes": [
    "com.rdcopilot.selfcheckout.basket.completed.v1",
    "com.rdcopilot.selfcheckout.intervention.raised.v1",
    "com.rdcopilot.selfcheckout.intervention.resolved.v1",
    "com.rdcopilot.selfcheckout.device.faulted.v1",
    "com.rdcopilot.selfcheckout.rollout.completed.v1"
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/subscriptions`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "8e655896-91cf-41d3-a9a8-e85ccf0142f3",
    "url": "https://events.brumar.example/selfcheckout/events",
    "eventTypes": [
      "com.rdcopilot.selfcheckout.basket.completed.v1",
      "com.rdcopilot.selfcheckout.intervention.raised.v1",
      "com.rdcopilot.selfcheckout.intervention.resolved.v1",
      "com.rdcopilot.selfcheckout.device.faulted.v1",
      "com.rdcopilot.selfcheckout.rollout.completed.v1"
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/subscriptions',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '8e655896-91cf-41d3-a9a8-e85ccf0142f3',
        'url': 'https://events.brumar.example/selfcheckout/events',
        'eventTypes': [
            'com.rdcopilot.selfcheckout.basket.completed.v1',
            'com.rdcopilot.selfcheckout.intervention.raised.v1',
            'com.rdcopilot.selfcheckout.intervention.resolved.v1',
            'com.rdcopilot.selfcheckout.device.faulted.v1',
            'com.rdcopilot.selfcheckout.rollout.completed.v1',
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "8e655896-91cf-41d3-a9a8-e85ccf0142f3",
  "url": "https://events.brumar.example/selfcheckout/events",
  "eventTypes": [
    "com.rdcopilot.selfcheckout.basket.completed.v1",
    "com.rdcopilot.selfcheckout.intervention.raised.v1",
    "com.rdcopilot.selfcheckout.intervention.resolved.v1",
    "com.rdcopilot.selfcheckout.device.faulted.v1",
    "com.rdcopilot.selfcheckout.rollout.completed.v1"
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/subscriptions');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/subscriptions");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "8e655896-91cf-41d3-a9a8-e85ccf0142f3",
  "url": "https://events.brumar.example/selfcheckout/events",
  "eventTypes": [
    "com.rdcopilot.selfcheckout.basket.completed.v1",
    "com.rdcopilot.selfcheckout.intervention.raised.v1",
    "com.rdcopilot.selfcheckout.intervention.resolved.v1",
    "com.rdcopilot.selfcheckout.device.faulted.v1",
    "com.rdcopilot.selfcheckout.rollout.completed.v1"
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "8e655896-91cf-41d3-a9a8-e85ccf0142f3",
  "status": "accepted",
  "aggregateId": "d71cb517-268f-4cd6-b28e-746d2fa7daf8",
  "aggregateRevision": 1,
  "secret": "whsec_k7T2nQ0vXw9mYb4Lr1ZcE8sJdUe5HfAa3GpRi6NtVoM="
}
```

## Rotate the secret of a subscription

POST `/selfcheckout/v1/subscriptions/{subscriptionId}/secret`

Returns a new signing secret, once. For 24 hours every delivery carries a signature made with each secret, then only the new one.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | `string (uuid)` | Yesrequired | The subscription. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The secret was replaced. The body is the operation result with the new secret, returned only here, once. | `SubscriptionOperationResult` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `404` | The subscription does not exist in your account. | `Error` |
| `409` | The `operationId` was already used with a different request. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/secret" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "613c9334-b4dd-47fb-8208-b4d166be8130"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/secret`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "613c9334-b4dd-47fb-8208-b4d166be8130"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/secret',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '613c9334-b4dd-47fb-8208-b4d166be8130',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "613c9334-b4dd-47fb-8208-b4d166be8130"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/secret');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/secret");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "613c9334-b4dd-47fb-8208-b4d166be8130"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "613c9334-b4dd-47fb-8208-b4d166be8130",
  "status": "accepted",
  "aggregateId": "d71cb517-268f-4cd6-b28e-746d2fa7daf8",
  "aggregateRevision": 2,
  "secret": "whsec_p3Wd8YhN1uBq6KxZ0cTmV9sLaJf2eRiG7oXyD4nHtQk="
}
```

## Check the endpoint

POST `/selfcheckout/v1/subscriptions/{subscriptionId}/check`

Asks the system to call your endpoint again. When it answers, the subscription is `healthy` and the deliveries that waited can be retried or replayed. It is refused when the endpoint already answers.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `subscriptionId` | path | `string (uuid)` | Yesrequired | The subscription. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was changed. | `OperationResult` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `404` | The subscription does not exist in your account. | `Error` |
| `409` | `operation_reused`: The `operationId` was already used with a different request. `endpoint_answering`: The event endpoint already answers. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/check" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "c057bf26-0b94-4f2d-a9e7-08bfda0c5231"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/check`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "c057bf26-0b94-4f2d-a9e7-08bfda0c5231"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/check',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'c057bf26-0b94-4f2d-a9e7-08bfda0c5231',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "c057bf26-0b94-4f2d-a9e7-08bfda0c5231"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/check');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/subscriptions/d71cb517-268f-4cd6-b28e-746d2fa7daf8/check");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "c057bf26-0b94-4f2d-a9e7-08bfda0c5231"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "c057bf26-0b94-4f2d-a9e7-08bfda0c5231",
  "status": "accepted",
  "aggregateId": "d71cb517-268f-4cd6-b28e-746d2fa7daf8",
  "aggregateRevision": 2
}
```

## List deliveries

GET `/selfcheckout/v1/deliveries`

Returns the deliveries of events, newest first, with every attempt. `state=parked` lists the events waiting for a replay.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `state` | query | `string` | Nooptional | Only deliveries in this state. One of `delivered`, `retrying`, `parked`, `replayed` |
| `limit` | query | `integer` | Nooptional | Records per page, from 1 to 500. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | The `nextCursor` of the previous page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of deliveries. | `DeliveryPage` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/selfcheckout/v1/deliveries?limit=20" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/deliveries?limit=20`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/deliveries?limit=20',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/deliveries?limit=20');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
    ],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/deliveries?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "items": [
    {
      "id": "4706e9f5-3b76-46e3-a9b1-a64e38ae021d",
      "type": "com.rdcopilot.selfcheckout.intervention.raised.v1",
      "subjectType": "intervention",
      "subjectId": "626ba1d4-2b3c-46d6-ad7d-962a8e1d8a98",
      "state": "retrying",
      "attempts": [
        {
          "n": 1,
          "http": 503,
          "at": "2026-11-23T07:11:21Z"
        }
      ],
      "maxAttempts": 6,
      "revision": 1
    },
    {
      "id": "8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402",
      "type": "com.rdcopilot.selfcheckout.rollout.completed.v1",
      "subjectType": "rollout",
      "subjectId": "d315256b-df5d-4b15-b9d0-2948b7cebcaa",
      "state": "parked",
      "attempts": [
        {
          "n": 1,
          "http": 503,
          "at": "2026-11-22T16:20:01Z"
        },
        {
          "n": 2,
          "http": 503,
          "at": "2026-11-22T16:21:01Z"
        },
        {
          "n": 3,
          "http": 503,
          "at": "2026-11-22T16:26:01Z"
        },
        {
          "n": 4,
          "http": 503,
          "at": "2026-11-22T16:56:01Z"
        },
        {
          "n": 5,
          "http": 503,
          "at": "2026-11-22T18:56:01Z"
        },
        {
          "n": 6,
          "http": 503,
          "at": "2026-11-23T06:56:01Z"
        }
      ],
      "maxAttempts": 6,
      "revision": 6
    }
  ],
  "nextCursor": null
}
```

## Retry a delivery

POST `/selfcheckout/v1/deliveries/{deliveryId}/retry`

Makes the next attempt for a delivery in `retrying`. After the last attempt the event is `parked`.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `deliveryId` | path | `string (uuid)` | Yesrequired | The delivery of the event. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `expectedRevision` | `integer` | Yesrequired | The revision of the record you read. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was changed. | `OperationResult` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `404` | The delivery does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `nothing_to_retry`: The delivery is not waiting for another attempt. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/deliveries/4706e9f5-3b76-46e3-a9b1-a64e38ae021d/retry" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "1062bfa1-b03b-4275-8f75-e5b500db3852",
  "expectedRevision": 1
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/deliveries/4706e9f5-3b76-46e3-a9b1-a64e38ae021d/retry`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "1062bfa1-b03b-4275-8f75-e5b500db3852",
    "expectedRevision": 1
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/deliveries/4706e9f5-3b76-46e3-a9b1-a64e38ae021d/retry',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '1062bfa1-b03b-4275-8f75-e5b500db3852',
        'expectedRevision': 1,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "1062bfa1-b03b-4275-8f75-e5b500db3852",
  "expectedRevision": 1
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/deliveries/4706e9f5-3b76-46e3-a9b1-a64e38ae021d/retry');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/deliveries/4706e9f5-3b76-46e3-a9b1-a64e38ae021d/retry");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "1062bfa1-b03b-4275-8f75-e5b500db3852",
  "expectedRevision": 1
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "1062bfa1-b03b-4275-8f75-e5b500db3852",
  "status": "accepted",
  "aggregateId": "4706e9f5-3b76-46e3-a9b1-a64e38ae021d",
  "aggregateRevision": 2
}
```

## Replay a parked event

POST `/selfcheckout/v1/deliveries/{deliveryId}/replay`

Delivers an event that was `parked` once your endpoint answers again. The delivery becomes `replayed`.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `deliveryId` | path | `string (uuid)` | Yesrequired | The delivery of the event. |

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `expectedRevision` | `integer` | Yesrequired | The revision of the record you read. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was changed. | `OperationResult` |
| `401` | The token is missing, not valid or has ended. | `Error` |
| `403` | The token does not give access to this data. | `Error` |
| `404` | The delivery does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `nothing_parked`: The delivery is not parked. `endpoint_not_answering`: The event endpoint still does not answer. | `Error` |
| `429` | Too many requests. The request was not processed. | `Error` |
| `503` | The service cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/selfcheckout/v1/deliveries/8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402/replay" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "361a2baa-3323-4194-8e86-293b9b89c379",
  "expectedRevision": 6
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/selfcheckout/v1/deliveries/8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402/replay`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "361a2baa-3323-4194-8e86-293b9b89c379",
    "expectedRevision": 6
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/selfcheckout/v1/deliveries/8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402/replay',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '361a2baa-3323-4194-8e86-293b9b89c379',
        'expectedRevision': 6,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "361a2baa-3323-4194-8e86-293b9b89c379",
  "expectedRevision": 6
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/selfcheckout/v1/deliveries/8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402/replay');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/selfcheckout/v1/deliveries/8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402/replay");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "361a2baa-3323-4194-8e86-293b9b89c379",
  "expectedRevision": 6
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "361a2baa-3323-4194-8e86-293b9b89c379",
  "status": "accepted",
  "aggregateId": "8ce78d6d-a1a9-4fdc-bb97-2b7c46f64402",
  "aggregateRevision": 7
}
```
