gift_cards

Create a gift card

Changed on

Create a gift card

post/gift_cards

Request

  • Base URL
    https://{your_organization_slug}.commercelayer.io/api
  • URL
    https://{your_organization_slug}.commercelayer.io/api/gift_cards
  • Auth
    HTTP bearer

Request body

Example request

{
  "data": {
    "attributes": {
      "code": "32db311a-75d9-4c17-9e34-2be220137ad6",
      "currency_code": "EUR",
      "balance_cents": 15000,
      "balance_max_cents": 100000,
      "rechargeable": true,
      "distribute_discount": true,
      "image_url": "https://img.yourdomain.com/gift_cards/32db311a.png",
      "expires_at": "2018-01-01T12:00:00.000Z",
      "recipient_email": "john@example.com",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "market": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "gift_card_recipient": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      },
      "tags": {
        "data": {
          "id": "XAyRWNUzyN"
        }
      }
    }
  }
}

Response

The created gift card object

Changes

    • breaking

      added the new required request property ///

    • breaking

      added the new required request property ///

    • breaking

      request property / was restricted to a list of enum values

    • breaking

      the // request property type changed from string to integer

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • warning

      removed the request property ///

    • info

      added the new optional request property //

    • info

      added the new optional request property //

    • info

      the request property default value gift_cards was removed

    • info

      added the new gift_cards enum value to the request property /

    • info

      added the media type application/vnd.api+json for the response with the status