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

🟢 Success Response (201 Created)
{
"data": {
"type": "gift_requests",
"id": "4fb4cb3f-9666-43b5-8884-7f5194483d1a",
"attributes": {
"redemption_url": "https://openai.andopen.co/r/1237676",
"status": "pending",
"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 \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer <api_key>' \
-H 'AndOpen-API-Version: 2025-09' \
-H 'AndOpen-Account: <customer_fqdn>' \
--data '{
"data": {
"type": "gift_requests",
"attributes": {
"campaign_id": "<campaign_id>",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
}
}
}' \
https://api.andopen.co/gift_requests