Anonymize Orders
POSThttps://useast.api.elasticpath.com/v2/orders/anonymize
You can anonymize an order when it is fulfilled, canceled, or fully refunded.
When anonymization is successful, Personal Identifiable Information such as customer details, shipping_address
, and billing_address
are replaced with *.
Request
- application/json
Body
data object
Responses
- 200
- 401
- 422
OK
- application/json
- Schema
- Example (auto)
Schema
data object
{
"data": {
"type": "order",
"order_number": "string",
"external_ref": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "complete",
"payment": "authorized",
"shipping": "unfulfilled",
"anonymized": true,
"payment_intent_id": "string",
"custom_attributes": {},
"meta": {
"timestamps": {
"created_at": "string"
},
"display_price": {
"with_tax": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"without_tax": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"tax": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"discount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"balance_owing": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"paid": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"authorized": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"without_discount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"shipping": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"shipping_discount": {
"amount": 0,
"currency": "string",
"formatted": "string"
}
}
},
"billing_address": {
"first_name": "string",
"last_name": "string",
"company_name": "string",
"line_1": "string",
"line_2": "string",
"city": "string",
"postcode": "string",
"county": "string",
"country": "string",
"region": "string"
},
"contact": {
"email": "string",
"name": "string"
},
"customer": {
"email": "string",
"name": "string"
},
"shipping_address": {
"first_name": "string",
"last_name": "string",
"phone_number": "string",
"company_name": "string",
"line_1": "string",
"line_2": "string",
"city": "string",
"postcode": "string",
"county": "string",
"country": "string",
"region": "string",
"instructions": "string"
},
"relationships": {
"items": {
"data": [
{
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
},
"custom_discounts": {
"data": [
{
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
},
"promotions": {
"data": [
{
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
},
"customer": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
},
"account": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
},
"account_member": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
}
}
}
Unauthorized
- application/json
- Schema
- Example (auto)
- Example
Schema
detailstring
statusstring
titlestring
[
null
]
{
"errors": {
"status": 401,
"title": "Unauthorized"
}
}
Not Found
- application/json
- Schema
- Example (auto)
- Example
Schema
detailstring
statusstring
titlestring
[
null
]
{
"errors": {
"detail": "Order has status: order:incomplete, payment:unpaid, shipping:unfulfilled; only fulfilled or refunded or cancelled orders may be anonymized",
"status": 422,
"title": "Could not anonymize orders",
"meta": {
"order_id": "496c29a1-6e7a-4ab6-a4e7-d1ec9a08b85e"
}
}
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/orders/anonymize");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"order_ids\": [\n \"string\"\n ]\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear