> This page is for Internet banking (beta).

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.docs.api.corpx.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.docs.api.corpx.com/_mcp/server.

# Cancel a P2P order

POST https://client.api.corpx.com/v1/accounts/{accountId}/p2p/orders/{orderId}/cancel
Content-Type: application/json

Cancels before both parties signed. The buyer's BRL returns to their balance and the ad's stock is freed.
Cancelling before signing your own copy marks the fault on you.


Reference: https://en.docs.api.corpx.com/ib/referencia/p-2-p/cancel-p-2-p-order

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `accountId` (string, required) — Account identifier.
- `orderId` (string, required) — P2P order identifier.

### Headers

- `X-Tenant-Id` (string, required) — Tenant context used for authorization and routing.
- `X-Acting-Document` (string, optional) — CPF of the human performing the operation. Required on cashout routes when the credential enforces a transaction PIN. On a company P2P profile contact, this CPF is the holder who signs; it is not taken from the body.
- `Idempotency-Key` (string, optional) — Optional client-generated idempotency token (recommended for safe retries).
- `X-Request-Timestamp` (string, required) — Unix seconds. Required on the signed host; tolerance is 300s either way (`403 request_timestamp_skew`).
- `X-Content-SHA256` (string, required) — Lowercase hex SHA-256 of the body. An empty body hashes the empty string, so the header is always present. Mismatch returns `400 body_hash_mismatch`.
- `X-Request-Signature` (string, required) — Detached JWS (`<protected>..<signature>`, ES256 or PS256) over `METHOD\nPATH?QUERY\nTIMESTAMP\nIDEMPOTENCY_KEY_OR_EMPTY\nX_CONTENT_SHA256`.

### Body (application/json)

This endpoint expects an object.

- `reason` (string, optional)

## Response

### 200

Cancelled

- `orderId` (string, optional) — Order identifier.
- `adId` (string, optional) — Ad taken.
- `role` (enum, optional) — Your role.
  - Allowed values: `buyer`, `seller`
- `side` (enum, optional) — Your side.
  - Allowed values: `buy`, `sell`
- `pair` (string, optional) — Pair code.
- `network` (string, optional) — Network.
- `status` (enum, optional) — Order status.
  - Allowed values: `opening`, `funded`, `signing`, `signed`, `crypto_sent`, `crypto_confirmed`, `released`, `disputed`, `resolved`, `cancelled`
- `amount` (string, optional) — BRL amount.
- `cryptoAmount` (string, optional) — Crypto amount.
- `price` (string, optional) — BRL price per unit locked at opening, 4 decimal places. The order amount is in cents.
- `fee` (string, optional) — CorpX fee.
- `feePayer` (enum, optional) — Party that pays the fee (the advertiser).
  - Allowed values: `buyer`, `seller`
- `heldAmount` (string, optional) — BRL held from the buyer (buyer view).
- `netAmount` (string, optional) — BRL the seller receives (seller view).
- `destinationAddress` (string, optional) — Wallet the crypto must reach.
- `counterparty` (P2POrderCounterparty, optional) — The other party: only `username` and reputation. Name and masked document appear only in the receipt (`GET .../p2p/orders/{orderId}/receipt`) of a concluded order.
- `holdId` (string, optional) — Hold of the buyer's BRL (buyer view).
- `deadlineAt` (datetime, optional, nullable) — The deadline running now for the current status; `null` in dispute or a final status.
- `concluded` (boolean, optional) — Detail only. `true` when the order is `released` (or `resolved` with `release_to_seller`), both parties signed, the seller was paid and the fee was charged.
- `concludedAt` (datetime, optional, nullable) — Detail only. When the last conclusion step happened.
- `timeline` (list of P2POrderTimelineEntry, optional) — Detail only. Order history from the viewer's point of view, oldest first.
- `dispute` (P2POrderDispute, optional) — Detail only, when the order has a dispute. The dispute plus `messages` and the viewer's own `evidence`.
- `signatureUrl` (string, optional) — Your signing link while your signature is pending.
- `signatures` (list of P2POrderSignaturesItems, optional) — Signature state per party.
- `txids` (list of P2POrderTxidsItems, optional) — Transactions reported by the seller.
- `contractAvailable` (boolean, optional) — Your signed copy can be downloaded.
- `signingDeadlineAt` (datetime, optional, nullable) — Buyer's signing deadline.
- `buyerSignedAt` (datetime, optional, nullable) — Buyer signed.
- `sellerSignedAt` (datetime, optional, nullable) — Seller signed.
- `sellerDeadlineAt` (datetime, optional, nullable) — Seller's deadline to sign and send.
- `onchainDeadlineAt` (datetime, optional, nullable) — Deadline for the network confirmation.
- `releaseDeadlineAt` (datetime, optional, nullable) — Buyer's deadline to release.
- `releasedBeforeConfirmed` (boolean, optional) — Released before the confirmations completed.
- `fundedAt` (datetime, optional, nullable) — BRL held.
- `signedAt` (datetime, optional, nullable) — Both signed.
- `cryptoSentAt` (datetime, optional, nullable) — Txid reported.
- `cryptoConfirmedAt` (datetime, optional, nullable) — Network confirmed.
- `releasedAt` (datetime, optional, nullable) — BRL released.
- `cancelledAt` (datetime, optional, nullable) — Cancelled.
- `disputedAt` (datetime, optional, nullable) — Dispute opened.
- `resolvedAt` (datetime, optional, nullable) — Dispute decided.
- `cancelledBy` (string, optional) — Who cancelled.
- `fault` (string, optional) — Party at fault.
- `cancelReason` (string, optional) — Cancellation reason.
- `lastError` (string, optional) — Last processing error.
- `createdAt` (datetime, optional, nullable) — Creation time.
- `updatedAt` (datetime, optional, nullable) — Last change.

### 202

Accepted; the order workflow applies it and `p2p.order.updated` follows.

- `orderId` (string, optional) — Order identifier.
- `adId` (string, optional) — Ad taken.
- `role` (enum, optional) — Your role.
  - Allowed values: `buyer`, `seller`
- `side` (enum, optional) — Your side.
  - Allowed values: `buy`, `sell`
- `pair` (string, optional) — Pair code.
- `network` (string, optional) — Network.
- `status` (enum, optional) — Order status.
  - Allowed values: `opening`, `funded`, `signing`, `signed`, `crypto_sent`, `crypto_confirmed`, `released`, `disputed`, `resolved`, `cancelled`
- `amount` (string, optional) — BRL amount.
- `cryptoAmount` (string, optional) — Crypto amount.
- `price` (string, optional) — BRL price per unit locked at opening, 4 decimal places. The order amount is in cents.
- `fee` (string, optional) — CorpX fee.
- `feePayer` (enum, optional) — Party that pays the fee (the advertiser).
  - Allowed values: `buyer`, `seller`
- `heldAmount` (string, optional) — BRL held from the buyer (buyer view).
- `netAmount` (string, optional) — BRL the seller receives (seller view).
- `destinationAddress` (string, optional) — Wallet the crypto must reach.
- `counterparty` (P2POrderCounterparty, optional) — The other party: only `username` and reputation. Name and masked document appear only in the receipt (`GET .../p2p/orders/{orderId}/receipt`) of a concluded order.
- `holdId` (string, optional) — Hold of the buyer's BRL (buyer view).
- `deadlineAt` (datetime, optional, nullable) — The deadline running now for the current status; `null` in dispute or a final status.
- `concluded` (boolean, optional) — Detail only. `true` when the order is `released` (or `resolved` with `release_to_seller`), both parties signed, the seller was paid and the fee was charged.
- `concludedAt` (datetime, optional, nullable) — Detail only. When the last conclusion step happened.
- `timeline` (list of P2POrderTimelineEntry, optional) — Detail only. Order history from the viewer's point of view, oldest first.
- `dispute` (P2POrderDispute, optional) — Detail only, when the order has a dispute. The dispute plus `messages` and the viewer's own `evidence`.
- `signatureUrl` (string, optional) — Your signing link while your signature is pending.
- `signatures` (list of P2POrderSignaturesItems, optional) — Signature state per party.
- `txids` (list of P2POrderTxidsItems, optional) — Transactions reported by the seller.
- `contractAvailable` (boolean, optional) — Your signed copy can be downloaded.
- `signingDeadlineAt` (datetime, optional, nullable) — Buyer's signing deadline.
- `buyerSignedAt` (datetime, optional, nullable) — Buyer signed.
- `sellerSignedAt` (datetime, optional, nullable) — Seller signed.
- `sellerDeadlineAt` (datetime, optional, nullable) — Seller's deadline to sign and send.
- `onchainDeadlineAt` (datetime, optional, nullable) — Deadline for the network confirmation.
- `releaseDeadlineAt` (datetime, optional, nullable) — Buyer's deadline to release.
- `releasedBeforeConfirmed` (boolean, optional) — Released before the confirmations completed.
- `fundedAt` (datetime, optional, nullable) — BRL held.
- `signedAt` (datetime, optional, nullable) — Both signed.
- `cryptoSentAt` (datetime, optional, nullable) — Txid reported.
- `cryptoConfirmedAt` (datetime, optional, nullable) — Network confirmed.
- `releasedAt` (datetime, optional, nullable) — BRL released.
- `cancelledAt` (datetime, optional, nullable) — Cancelled.
- `disputedAt` (datetime, optional, nullable) — Dispute opened.
- `resolvedAt` (datetime, optional, nullable) — Dispute decided.
- `cancelledBy` (string, optional) — Who cancelled.
- `fault` (string, optional) — Party at fault.
- `cancelReason` (string, optional) — Cancellation reason.
- `lastError` (string, optional) — Last processing error.
- `createdAt` (datetime, optional, nullable) — Creation time.
- `updatedAt` (datetime, optional, nullable) — Last change.

## Errors

### 403 Forbidden Error

`feature_disabled`.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 404 Not Found Error

`order_not_found`.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

### 409 Conflict Error

`order_not_cancellable`.

- `errorCode` (string, required) — Stable machine-readable code. See `ErrorCode` for the known values.
- `message` (string, required) — Human-readable explanation (pt-BR). Presentation only; may change.
- `docs` (string, optional) — Link to this code in the public error catalogue.
- `requestId` (string, optional) — Gateway request id. Quote it when contacting support.
- `details` (map from string to any, optional) — Optional machine-readable context for the specific `errorCode` (for example `kind` on `identity_verification_monthly_limit_exceeded`, `maxBytes` on `payload_too_large`, `attemptsRemaining` on `facetec_attempts_exhausted`). Keys are documented per operation; absent when the code carries no extra context.
- `partner` (ErrorResponsePartner, optional) — Raw error from the settlement bank, when the failure came from it. Diagnostic only.

## Types

### P2POrderCounterparty

The other party: only `username` and reputation. Name and masked document appear only in the receipt (`GET .../p2p/orders/{orderId}/receipt`) of a concluded order.

- `username` (string, optional) — Username.
- `reputation` (P2PReputation, optional) — Trading statistics. Values below the tenant's minimum number of orders are `null`.

### P2POrderTimelineEntry

One step of the order history. `title` is ready to show, in Portuguese and relative to the viewer. The counterparty is never named and CorpX staff shows only as `corpx`.

- `at` (datetime, optional)
- `type` (string, optional) — Step type (`funded`, `signing_started`, `buyer_signed`, `crypto_sent`, `txid_checked`, `crypto_confirmed`, `released`, `dispute_opened`, `cancelled`, `fee_charged`, ...).
- `title` (string, optional)
- `actor` (enum, optional)
  - Allowed values: `buyer`, `seller`, `corpx`, `system`
- `actorIsYou` (boolean, optional)
- `fromStatus` (string, optional)
- `toStatus` (string, optional)
- `data` (map from string to any, optional) — Public fields of the step (amount, deadline, txid, confirmations, reason).

### P2POrderDispute

Detail only, when the order has a dispute. The dispute plus `messages` and the viewer's own `evidence`.

### P2POrderSignaturesItems

- `role` (string, optional) — Party.
- `status` (enum, optional) — Signature status.
  - Allowed values: `pending`, `sent`, `signed`, `rejected`, `expired`, `cancelled`
- `signedAt` (datetime, optional, nullable) — Signing time.

### P2POrderTxidsItems

- `txid` (string, optional) — Transaction id.
- `network` (string, optional) — Network.
- `checkStatus` (string, optional) — Check status.
- `onchainStatus` (string, optional) — Network status.
- `screeningStatus` (string, optional) — Risk screening of the transaction.
- `amount` (string, optional) — Amount seen on the network.
- `confirmations` (integer, optional) — Confirmations.
- `checkedAt` (datetime, optional, nullable) — Last check.
- `createdAt` (datetime, optional, nullable) — Report time.

### ErrorResponsePartner

Raw error from the settlement bank, when the failure came from it. Diagnostic only.

- `code` (string, optional)
- `message` (string, optional)
- `field` (string, optional) — Field the partner pointed at, when any.

### P2PReputation

Trading statistics. Values below the tenant's minimum number of orders are `null`.

- `tradesTotal` (integer, optional) — Completed orders.
- `completionPercent` (string, optional, nullable) — Completed over taken orders, in percent.
- `deliveryMedianSeconds` (integer, optional, nullable) — Median seconds between both signing and the crypto being sent.
- `deliveryPercentile` (integer, optional, nullable) — Percentile of the delivery time within the market (higher is faster).

## Examples

### P2P_cancelP2POrder_example

**Request**

```json
{
  "reason": "desisti"
}
```

**Response**

```json
{
  "orderId": "p2o_01JB8Z6Q4C9K7X2M3N5P",
  "adId": "p2a_01JB8Z6Q4C9K7X2M3N5P",
  "role": "buyer",
  "side": "buy",
  "pair": "USDT_TRON",
  "network": "TRON",
  "status": "cancelled",
  "amount": "546.00",
  "cryptoAmount": "100",
  "price": "5.46",
  "fee": "0.00",
  "feePayer": "seller",
  "heldAmount": "546.00",
  "destinationAddress": "TQ5Nj4oxdkN1kq6bQSgWvVQb8m1Gj8hQ2x",
  "counterparty": {
    "username": "mesa.sul",
    "reputation": {
      "tradesTotal": 42,
      "completionPercent": "97.61",
      "deliveryMedianSeconds": 540,
      "deliveryPercentile": 82
    }
  },
  "signatureUrl": "https://sign.dracmatrust.com/s/8f2c1a",
  "signatures": [
    {
      "role": "buyer",
      "status": "sent",
      "signedAt": null
    },
    {
      "role": "seller",
      "status": "pending",
      "signedAt": null
    }
  ],
  "txids": [],
  "contractAvailable": false,
  "signingDeadlineAt": "2026-10-31T14:20:00Z",
  "buyerSignedAt": null,
  "sellerSignedAt": null,
  "sellerDeadlineAt": null,
  "onchainDeadlineAt": null,
  "releaseDeadlineAt": null,
  "releasedBeforeConfirmed": false,
  "fundedAt": "2026-10-31T14:05:00Z",
  "cancelledBy": "buyer",
  "fault": "buyer",
  "cancelReason": "buyer_cancelled",
  "createdAt": "2026-10-31T14:05:00Z",
  "updatedAt": "2026-10-31T14:05:00Z"
}
```

**SDK Code**

```python P2P_cancelP2POrder_example
import requests

url = "https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel"

payload = { "reason": "desisti" }
headers = {
    "X-Content-SHA256": "X-Content-SHA256",
    "X-Request-Signature": "X-Request-Signature",
    "X-Request-Timestamp": "X-Request-Timestamp",
    "X-Tenant-Id": "X-Tenant-Id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript P2P_cancelP2POrder_example
const url = 'https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel';
const options = {
  method: 'POST',
  headers: {
    'X-Content-SHA256': 'X-Content-SHA256',
    'X-Request-Signature': 'X-Request-Signature',
    'X-Request-Timestamp': 'X-Request-Timestamp',
    'X-Tenant-Id': 'X-Tenant-Id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"reason":"desisti"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go P2P_cancelP2POrder_example
package main

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

func main() {

	url := "https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel"

	payload := strings.NewReader("{\n  \"reason\": \"desisti\"\n}")

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

	req.Header.Add("X-Content-SHA256", "X-Content-SHA256")
	req.Header.Add("X-Request-Signature", "X-Request-Signature")
	req.Header.Add("X-Request-Timestamp", "X-Request-Timestamp")
	req.Header.Add("X-Tenant-Id", "X-Tenant-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(res)
	fmt.Println(string(body))

}
```

```ruby P2P_cancelP2POrder_example
require 'uri'
require 'net/http'

url = URI("https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel")

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

request = Net::HTTP::Post.new(url)
request["X-Content-SHA256"] = 'X-Content-SHA256'
request["X-Request-Signature"] = 'X-Request-Signature'
request["X-Request-Timestamp"] = 'X-Request-Timestamp'
request["X-Tenant-Id"] = 'X-Tenant-Id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reason\": \"desisti\"\n}"

response = http.request(request)
puts response.read_body
```

```java P2P_cancelP2POrder_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel")
  .header("X-Content-SHA256", "X-Content-SHA256")
  .header("X-Request-Signature", "X-Request-Signature")
  .header("X-Request-Timestamp", "X-Request-Timestamp")
  .header("X-Tenant-Id", "X-Tenant-Id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"desisti\"\n}")
  .asString();
```

```php P2P_cancelP2POrder_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel', [
  'body' => '{
  "reason": "desisti"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Content-SHA256' => 'X-Content-SHA256',
    'X-Request-Signature' => 'X-Request-Signature',
    'X-Request-Timestamp' => 'X-Request-Timestamp',
    'X-Tenant-Id' => 'X-Tenant-Id',
  ],
]);

echo $response->getBody();
```

```csharp P2P_cancelP2POrder_example
using RestSharp;

var client = new RestClient("https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Content-SHA256", "X-Content-SHA256");
request.AddHeader("X-Request-Signature", "X-Request-Signature");
request.AddHeader("X-Request-Timestamp", "X-Request-Timestamp");
request.AddHeader("X-Tenant-Id", "X-Tenant-Id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reason\": \"desisti\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift P2P_cancelP2POrder_example
import Foundation

let headers = [
  "X-Content-SHA256": "X-Content-SHA256",
  "X-Request-Signature": "X-Request-Signature",
  "X-Request-Timestamp": "X-Request-Timestamp",
  "X-Tenant-Id": "X-Tenant-Id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["reason": "desisti"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### P2P_cancelP2POrder_example

**Request**

```json
{
  "reason": "desisti"
}
```

**Response**

```json
{
  "orderId": "p2o_01JB8Z6Q4C9K7X2M3N5P",
  "adId": "p2a_01JB8Z6Q4C9K7X2M3N5P",
  "role": "buyer",
  "side": "buy",
  "pair": "USDT_TRON",
  "network": "TRON",
  "status": "signing",
  "amount": "546.00",
  "cryptoAmount": "100",
  "price": "5.46",
  "fee": "0.00",
  "feePayer": "seller",
  "heldAmount": "546.00",
  "destinationAddress": "TQ5Nj4oxdkN1kq6bQSgWvVQb8m1Gj8hQ2x",
  "counterparty": {
    "username": "mesa.sul",
    "reputation": {
      "tradesTotal": 42,
      "completionPercent": "97.61",
      "deliveryMedianSeconds": 540,
      "deliveryPercentile": 82
    }
  },
  "signatureUrl": "https://sign.dracmatrust.com/s/8f2c1a",
  "signatures": [
    {
      "role": "buyer",
      "status": "sent",
      "signedAt": null
    },
    {
      "role": "seller",
      "status": "pending",
      "signedAt": null
    }
  ],
  "txids": [],
  "contractAvailable": false,
  "signingDeadlineAt": "2026-10-31T14:20:00Z",
  "buyerSignedAt": null,
  "sellerSignedAt": null,
  "sellerDeadlineAt": null,
  "onchainDeadlineAt": null,
  "releaseDeadlineAt": null,
  "releasedBeforeConfirmed": false,
  "fundedAt": "2026-10-31T14:05:00Z",
  "createdAt": "2026-10-31T14:05:00Z",
  "updatedAt": "2026-10-31T14:05:00Z"
}
```

**SDK Code**

```python P2P_cancelP2POrder_example
import requests

url = "https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel"

payload = { "reason": "desisti" }
headers = {
    "X-Content-SHA256": "X-Content-SHA256",
    "X-Request-Signature": "X-Request-Signature",
    "X-Request-Timestamp": "X-Request-Timestamp",
    "X-Tenant-Id": "X-Tenant-Id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript P2P_cancelP2POrder_example
const url = 'https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel';
const options = {
  method: 'POST',
  headers: {
    'X-Content-SHA256': 'X-Content-SHA256',
    'X-Request-Signature': 'X-Request-Signature',
    'X-Request-Timestamp': 'X-Request-Timestamp',
    'X-Tenant-Id': 'X-Tenant-Id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"reason":"desisti"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go P2P_cancelP2POrder_example
package main

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

func main() {

	url := "https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel"

	payload := strings.NewReader("{\n  \"reason\": \"desisti\"\n}")

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

	req.Header.Add("X-Content-SHA256", "X-Content-SHA256")
	req.Header.Add("X-Request-Signature", "X-Request-Signature")
	req.Header.Add("X-Request-Timestamp", "X-Request-Timestamp")
	req.Header.Add("X-Tenant-Id", "X-Tenant-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(res)
	fmt.Println(string(body))

}
```

```ruby P2P_cancelP2POrder_example
require 'uri'
require 'net/http'

url = URI("https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel")

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

request = Net::HTTP::Post.new(url)
request["X-Content-SHA256"] = 'X-Content-SHA256'
request["X-Request-Signature"] = 'X-Request-Signature'
request["X-Request-Timestamp"] = 'X-Request-Timestamp'
request["X-Tenant-Id"] = 'X-Tenant-Id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reason\": \"desisti\"\n}"

response = http.request(request)
puts response.read_body
```

```java P2P_cancelP2POrder_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel")
  .header("X-Content-SHA256", "X-Content-SHA256")
  .header("X-Request-Signature", "X-Request-Signature")
  .header("X-Request-Timestamp", "X-Request-Timestamp")
  .header("X-Tenant-Id", "X-Tenant-Id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"desisti\"\n}")
  .asString();
```

```php P2P_cancelP2POrder_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel', [
  'body' => '{
  "reason": "desisti"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Content-SHA256' => 'X-Content-SHA256',
    'X-Request-Signature' => 'X-Request-Signature',
    'X-Request-Timestamp' => 'X-Request-Timestamp',
    'X-Tenant-Id' => 'X-Tenant-Id',
  ],
]);

echo $response->getBody();
```

```csharp P2P_cancelP2POrder_example
using RestSharp;

var client = new RestClient("https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Content-SHA256", "X-Content-SHA256");
request.AddHeader("X-Request-Signature", "X-Request-Signature");
request.AddHeader("X-Request-Timestamp", "X-Request-Timestamp");
request.AddHeader("X-Tenant-Id", "X-Tenant-Id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reason\": \"desisti\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift P2P_cancelP2POrder_example
import Foundation

let headers = [
  "X-Content-SHA256": "X-Content-SHA256",
  "X-Request-Signature": "X-Request-Signature",
  "X-Request-Timestamp": "X-Request-Timestamp",
  "X-Tenant-Id": "X-Tenant-Id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["reason": "desisti"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://client.api.corpx.com/v1/accounts/accountId/p2p/orders/p2o_01JB8Z6Q4C9K7X2M3N5P/cancel")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```