How to add a transaction for a gift card?

Topic summary

A developer is attempting to add a transaction for a gift card using the Shopify API but encountering validation errors.

Technical Issue:

  • The API request uses the “sale” transaction kind with “gift_card” as the gateway
  • Error received: {"errors": {"gift_card_id": ["can't be blank"]}}
  • The gift_card_id field is being sent as a number (644042064163) in the request body
  • Developer tried sending it as a string and in an array format, but the error persists

Current Status:

  • The issue remains unresolved
  • A second user has asked if any solution has been found yet
  • No working solution or explanation has been provided in the thread
Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.
{
    "transaction": {
        "kind": "sale",
        "status": "success",
        "amount": 10,
        "gateway": "gift_card",
        "gift_card_id": 644042064163,
        "gift_card_last_characters": "jqtd",
        "source": "external",
        "currency": "INR",
        "receipt": {
            "gift_card_id": 644042064163,
            "gift_card_last_characters": "jqtd"
        }
    }
}

This is the body for the request.

{
    "errors": {
        "gift_card_id": [
            "can't be blank"
        ]
    }
}

Getting this error in response.
Tried sending the gift_card_id as a string, in an array, naming it as just “id”.

1 Like

any solution to this yet?