POST /sale-discount-codes.json

POST /sale-discount-codes.json
application/json

Body Required

  • amount number(float) Required

    Amount

  • code string Required

    Code

  • saleId integer(int32) Required

    Sale

  • type string Required

    Type

    Values are percentage, shipping, or fixed_amount. Default value is fixed_amount.

Responses

  • 200 application/json

    Successful response

    Hide response attributes Show response attributes object
    • amount number(float) Required

      Amount

    • code string Required

      Code

    • createdAt string(date-time)

      Created at

    • id integer(int32)

      Id

    • saleId integer(int32) Required

      Sale

    • type string Required

      Type

      Values are percentage, shipping, or fixed_amount. Default value is fixed_amount.

    • updatedAt string(date-time)

      Updated at

POST /sale-discount-codes.json
curl \
 -X POST http://api.example.com/v1/sale-discount-codes.json \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"amount":42.0,"code":"string","saleId":42,"type":"fixed_amount"}'
Request example
{
  "amount": 42.0,
  "code": "string",
  "saleId": 42,
  "type": "fixed_amount"
}
Response examples (200)
{
  "amount": 42.0,
  "code": "string",
  "createdAt": "2024-05-04T09:42:00+00:00",
  "id": 42,
  "saleId": 42,
  "type": "fixed_amount",
  "updatedAt": "2024-05-04T09:42:00+00:00"
}