• Promotions/
    Promotion Codes/
    Delete Promotion Codes

    Delete Promotion Codes

    DELETE Delete a promotion code

    https://api.moltin.com/v2/promotions/:id/codes/:code
    

    Use this endpoint to delete a single promotion code.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    idRequiredstringSpecifies ID of the promotion associated with the codes.
    codeRequiredstringSpecifies the code that you want to delete.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Request example

    curl -X DELETE https://api.moltin.com/v2/promotions/:id/codes/:code \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json"
    

    Response example

    204 No Content

    DELETE Delete multiple promotion codes

    https://api.moltin.com/v2/promotions/:id/codes
    

    Use this endpoint to delete one or more promotion codes.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    idRequiredstringID of the promotion associated with the codes.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    codes[].codeRequiredobjectSpecifies the code that you want to delete.
    codes[]RequiredarraySpecifies an array of codes.
    typeRequiredstringSpecifies the type of the resource, you must use promotion_codes.

    Request example

    curl -X DELETE https://api.moltin.com/v2/promotions/:id/codes \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
          "data":{
            "type":"promotion_codes",
            "codes": [
              {"code":"ZXY_CBA"},
              {"code":"ABC_XYZ"}
            ]
          }
        }'
    

    Response example

    204 No Content

    Was this helpful?

    Previous
    Create Promotion codes