Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.45 KB

delete-a-collection.md

File metadata and controls

66 lines (51 loc) · 1.45 KB

Delete a Collection

{% api-method method="delete" host="https://api.moltin.com" path="/v2/collections/:id" %} {% api-method-summary %} Delete by ID {% endapi-method-summary %}

{% api-method-description %}

{% endapi-method-description %}

{% api-method-spec %} {% api-method-request %} {% api-method-path-parameters %} {% api-method-parameter name="id" type="string" required=true %} The ID for the Collection to delete {% endapi-method-parameter %} {% endapi-method-path-parameters %}

{% api-method-headers %} {% api-method-parameter name="Authorization" type="string" required=true %} The Bearer token to grant access to the API {% endapi-method-parameter %} {% endapi-method-headers %} {% endapi-method-request %}

{% api-method-response %} {% api-method-response-example httpCode=204 %} {% api-method-response-example-description %}

{% endapi-method-response-example-description %}

{% endapi-method-response-example %} {% endapi-method-response %} {% endapi-method-spec %} {% endapi-method %}

{% tabs %} {% tab title="cURL" %}

curl -X DELETE https://api.moltin.com/v2/collections/:id \
     -H "Authorization: Bearer XXXX"

{% endtab %}

{% tab title="JavaScript SDK" %}

const MoltinGateway = require('@moltin/sdk').gateway

const Moltin = MoltinGateway({
  client_id: 'X',
  client_secret: 'X'
})

const id = 'XXXX'

Moltin.Collections.Delete(id).then(response => {
  // Do something
})

{% endtab %} {% endtabs %}