# Cancel Order

##

## Update Order

<mark style="color:green;">`PUT`</mark> `https://app.pgprints.io/api/v1/order/cancel`

Update an order

#### Headers

| Name                                                     | Type   | Description                                                                                                              |
| -------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
| Content-Type<mark style="color:red;">\*</mark>           | string | application/json                                                                                                         |
| X-PGPrints-Store-Id<mark style="color:red;">\*</mark>    | string | use the Store ID taken from the Manage Keys                                                                              |
| X-PGPrints-Hmac-Sha256<mark style="color:red;">\*</mark> | string | see the authentication: [https://pgprints.gitbook.io/api/authentication](https://pgprints.gitbook.io/api/authentication) |

#### Request Body

| Name                                      | Type   | Description           |
| ----------------------------------------- | ------ | --------------------- |
| orderId<mark style="color:red;">\*</mark> | string | pgcOrderId or orderId |

{% tabs %}
{% tab title="200: OK Order update successful" %}

{% endtab %}

{% tab title="400: Bad Request Bad request" %}

{% endtab %}
{% endtabs %}

```json
// example body
{
  "orderId": "G-20035"
}

```

This is my code in some language:

{% tabs %}
{% tab title="NodeJS" %}
```javascript
//example nodejs with axios
const axios = require('axios');
let data = JSON.stringify({"body"});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://app.pgprints.io/api/v1/order/cancel',
  headers: { 
    'Content-Type': 'application/json', 
    'X-PGPrints-Store-Id': '64c9d58aa6cead5392e73711', 
    'X-PGPrints-Hmac-Sha256': 'zz1/IH/V/Q+/00ImpP2CosYQb43qJn1nOwJd5/czDns='
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```
{% endtab %}
{% endtabs %}
