PUT Create a gift certificate using the information provided.
PUT /organizations/{organizationId}/gift-certificates
Operation ID: createGiftCertificate. Security: AmOAuth2 (sfcc.gift-certificates.rw).
If an existing identifier is specified, the gift certificate with that unique identifier is deleted and a new one is created.
Parameters
organizationId(path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.Example
f_ecom_zzxy_prdsiteId(query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.Example: SiteId
RefArch
Request body (required)
Media type: application/json. Schema: GiftCertificate.
Example: Gift-Certificates
{
"amount": {
"currencyMnemonic": "USD",
"value": 1000
},
"description": "Birthday gift",
"message": "A birthday present to you",
"senderName": "Jane Doe",
"recipientName": "John Doe",
"recipientEmail": "john.doe@gmail.com",
"status": "issued",
"orderNo": "CA17293",
"enabled": false
}
Responses
- 200
Successfully created the gift certificate.
Media type:
application/json. Schema:GiftCertificate.Example: CreateGiftCertificateSuccess
{ "amount": { "currencyMnemonic": "USD", "value": 100 }, "balance": { "currencyMnemonic": "USD", "value": 100 }, "creationDate": "2015-07-31T14:36:17.544Z", "description": "Birthday gift", "enabled": false, "maskedGiftCertificateCode": "************KTIP", "merchantId": "NorthernTrailOutfitters", "message": "A birthday gift for you", "orderNo": "CA17293", "recipientName": "John Doe", "recipientEmail": "john.doe@gmail.com", "senderName": "Jane Doe", "status": "issued", "transactions": [ { "amount": { "currencyMnemonic": "EUR", "value": 80 }, "orderNo": "my-order_no", "timestamp": "2015-09-09T17:16:12.066Z", "typeCode": "create" } ] } - 400
Potential reasons:
- Returned when the merchant ID is not unique.
- Returned when the specified gift certificate status is invalid.
- Returned when the specified gift certificate is not valid (the argument indicates the field that was invalid).
- Returned when the specified amount is out of range.
Media type:
application/json. Schema:ErrorResponse.Example: InvalidRecipientEmail400
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/invalid-recipient-email", "title": "Invalid Recipient Email Exception", "detail": "Invalid recipient email ID provided." }Example: InvalidStatus400
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/invalid-status", "title": "Invalid Gift Certificate Status Exception", "detail": "Invalid gift certificate status provided." }Example: Invalid400
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/invalid", "title": "Invalid Gift Certificate Exception", "detail": "Invalid gift certificate provided." }Example: MerchantIdNotUnique400
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/merchant-id-not-unique", "title": "Gift Certificate Create Merchant Id Not Unique Exception", "detail": "Merchant id is not unique." } - 404
Returned when the gift certificate does not exist or does not match the specified merchant ID.
Media type:
application/json. Schema:ErrorResponse.Example: createGiftCertificate404
{ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/not-found", "title": "Gift Certificate Not Found Exception", "detail": "No gift certificate with merchant ID 'my-merchant_id' for site 'TestWapi' was found." }