Update a Gift Certificate: /gift_certificates/{uuid}
Purpose
This endpoint is used to update the details of an existing gift certificate by providing its UUID. It enables modifications to key fields such as accounting code, expiry date, and custom attributes. The certificate's code can also be regenerated based on a new prefix and length if specified.
Use Case
A business administrator can update a gift certificate's details to align with changes, such as extending the expiry date, adjusting custom attributes for personalized promotions, or rebranding the gift certificate code for better tracking.
Path Parameters
Parameter | Type | Description |
---|---|---|
uuid | string | The unique identifier of the gift certificate to be updated. |
Query Parameters
No query parameter is required for this endpoint.
Request Body
The request body allows updating the gift certificate's key details, such as its accounting code, expiry date, and custom attributes. You can optionally regenerate the gift certificate code using a new prefix and length. This flexibility helps align the certificate with changing requirements or rebranding efforts.
{
"gift_certificate": {
"expiry_date": "EXPIRY_DATE"
}
}
Attribute | Type | Description |
---|---|---|
expiry_date | String (Date) | Expiry date of the gift certificate (YYYY-MM-DD format) |
Response
The response confirms the updated gift certificate details, reflecting the changes made. It includes revised metadata (expiry date, custom attributes, and code if regenerated), ensuring the system and stakeholders are aligned with the updated state of the certificate.
Response Body
{
"gift_certificate": {
"status": "STATUS_PLACEHOLDER",
"accounting_code": "ACCOUNTING_CODE",
"code": "CODE_PLACEHOLDER",
"amount": "AMOUNT_PLACEHOLDER",
"remaining_balance": "BALANCE_PLACEHOLDER",
"used_amount": "USED_AMOUNT_PLACEHOLDER",
"currency": "CURRENCY_PLACEHOLDER",
"expiry_date": "YYYY-MM-DDTHH:MM:SSZ",
"created_by": "CREATOR_PLACEHOLDER",
"created_on": "YYYY-MM-DDTHH:MM:SSZ",
"last_updated_by": "UPDATER_PLACEHOLDER",
"last_updated_on": "YYYY-MM-DDTHH:MM:SSZ",
"uuid": "UUID-PLACEHOLDER",
"custom_attributes": [
{
"attribute": {
"id": "ATTRIBUTE_ID",
"name": "ATTRIBUTE_NAME"
},
"value": "ATTRIBUTE_VALUE"
}
],
"allocations": [
{
"date": "YYYY-MM-DDTHH:MM:SSZ",
"type": "TYPE_PLACEHOLDER",
"account": "ACCOUNT_PLACEHOLDER"
}
],
"transactions": [
{
"date": "YYYY-MM-DDTHH:MM:SSZ",
"type": "TRANSACTION_TYPE_PLACEHOLDER",
"accounting_code": "ACCOUNTING_CODE",
"amount": "TRANSACTION_AMOUNT_PLACEHOLDER",
"currency": "CURRENCY_PLACEHOLDER",
"reference": "REFERENCE_PLACEHOLDER"
}
]
}
}
Attribute | Type | Description |
---|---|---|
status | String | Current status of the gift certificate (example: ACTIVE, INACTIVE) |
accounting_code | String | Accounting code linked to the gift certificate |
code | String | Unique gift certificate code |
amount | String (Decimal) | Original issued amount of the gift certificate |
remaining_balance | String (Decimal) | Current unused balance |
used_amount | String (Decimal) | Total amount already used |
currency | String | Currency code (example: AUD, USD) |
expiry_date | String (DateTime) | Expiry date of the gift certificate |
created_by | String | User who created the gift certificate |
created_on | String (DateTime) | Timestamp of creation |
last_updated_by | String | User who last updated the record |
last_updated_on | String (DateTime) | Timestamp of last update |
uuid | String (UUID) | Unique identifier for the gift certificate |
custom_attributes | Array | List of custom attributes attached |
allocations | Array | Allocation history of the gift certificate |
transactions | Array | Transaction history of the gift certificate |