Composable Frontend 2.0 Learn more 

  • Commerce Cloud/
    Carts/
    Customer Cart Associations API/
    Delete an Association

    Delete a Customer-Cart Association

    You can delete an association between a customer and a cart.

    DELETE Delete an association

    https://useast.api.elasticpath.com/v2/carts/:cartId/relationships/customers
    

    Deletes an association between a cart (:cartId) and a customer.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    cartIdRequiredstringThe id for the cart created by the customer.

    Headers

    NameRequiredTypeDescription
    X-Moltin-Customer-TokenRequiredstringA customer token to access a specific customer's carts.
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    data[].typeRequiredstringThe type of related object. Ensure that it is customer.
    data[].idRequiredstringThe id of the customer.

    Request Examples

    With customer token

    Requires an implicit token with a customer token.

    Pass the X-Moltin-Customer-Token header to limit carts to a specific customer. For more information, see Using a token.

    curl -X DELETE https://useast.api.elasticpath.com/v2/carts/:cartId/relationships/customers \
         -H "X-Moltin-Customer-Token: XXXX" \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $ {
          "data": [{
              "type": "customer",
              "id": "b3f2b6de-8fd4-4cdf-a9d9-c5f7cecccdfe"
              }]
          }
    

    Without customer token

    Requires a client_credentials token.

    curl -X DELETE https://useast.api.elasticpath.com/v2/carts/:cartId/relationships/customers \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $ {
          "data": [{
              "type": "customer",
              "id": "b3f2b6de-8fd4-4cdf-a9d9-c5f7cecccdfe"
              }]
          }
    

    Response Example

    204 No Content

    
    
    
    Previous
    Create an Association