Skip to main content

POST /gift_requests

Create a new gift request.

Description

This endpoint allows you to create a new gift request for a recipient. The request will be processed and a unique ID will be generated for tracking.

HTTP Request

POST https://api.andopen.com/gift_requests

Request Body

JSON Schema

"data": {
"type": "gift_requests",
"attributes": {
"campaign_id": "string", "format": "uuid"
"first_name": "string",
"last_name": "string",
"email": "string", "format": "email"
}
}

Request Body Parameters

The request body must follow JSON:API specification.

ParameterTypeRequiredDescription
dataobjectYesRoot data object
data.typestringYesMust be "gift_requests"
data.attributesobjectYesAttributes of the gift request

data.attributes Parameters

ParameterTypeRequiredDescriptionValidation
campaign_idstringYesUnique identifier for the campaignMust be a valid campaign ID
first_namestringYesRecipient's first name2-255 characters, letters only
last_namestringYesRecipient's last name2-255 characters, letters only
emailstringNoRecipient's email addressValid email format

Responses

The state field indicates the current status of the gift request and can have one of the following values:

ValueDescription
submittedGift request has been submitted and is awaiting redemption
redeemedGift request has been redeemed by the recipient
dispatchedGift has been dispatched for delivery
deliveredGift has been successfully delivered
cancelledGift request has been cancelled
🟢 Success Response (201 Created)
{
"data": {
"type": "gift_requests",
"id": "4fb4cb3f-9666-43b5-8884-7f5194483d1a",
"attributes": {
"redemption_url": "https://from.andopen.co/r/yJVd73kgurRzEX",
"state": "submitted",
"created_at": "2025-01-27T10:30:00Z",
"updated_at": "2025-01-27T10:30:00Z"
}
}
}
🔴 Error Response (422 UnprocessableEntity)
{
"errors":
[
{
"status": "422",
"detail": "campaing_id does not exist"
}
],
"jsonapi": {
"version": "1.0"
}
}
🔴 Error Response (422 Parameter Missing)
{
"errors":
[
{
"status": "422",
"detail": "param is missing or the value is empty or invalid: <parameter>"
}
],
"jsonapi": {
"version": "1.0"
}
}

Code Examples

curl -X POST "https://api.andopen.co/gift_requests" \
-H "Content-Type: application/vnd.api+json" \
-H "Authorization: Bearer <api_key>" \
-H "AndOpen-API-Version: 2025-09" \
--data '{
"data": {
"type": "gift_requests",
"attributes": {
"campaign_id": "<campaign_id>",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
}
}
}'