# Allocate This function requests that a new gift card be allocated for use under a specific Program ID. The new card will be generated during the request and activated with the requested amount. - Host Direct - Locally Installed UTG See the Integration Methods and URLs Section sections of the Development Quick Start guide for details regarding each processing option. Endpoint: POST /giftcards/allocate Version: 1.7.43 Security: AccessToken ## Header parameters: - `InterfaceVersion` (string, required) Refers to the version of the program or application that is sending requests to Shift4. The following special characters are not allowed: $ % : ^ - ~ , ? “ ” ‘ ’ { } [ ] \ + = Example: "2.1" - `InterfaceName` (string, required) Refers to the name of the program or application that is sending requests to Shift4. This should be the name of the program that you purchased or created. The following special characters are not allowed: $ % : ^ - ~ ` , ? “ ” ‘ ’ { } [ ] \ + = Example: "ForwardPOS" - `CompanyName` (string, required) Refers to the vendor or partner that designed and certified the interface. The information you use in this field should match what Shift4 has on file or what was agreed upon in your Integration Plan. The following special characters are not allowed: $ % : ^ - ~ ` , ? “ ” ‘ ’ { } [ ] \ + = Example: "PAWS" - `AccessToken` (string, required) A security credential used to authenticate API requests and all i4Go® authorizeClient/preauthorizeClient requests. An Access Token is the alias for the merchant account and interface being used. The Access Token is required in all requests except an Access Token Exchange request, which generates an Access Token using an and . Example: "EA79FB05-3AA7-4500-AF9A-73F986FF2C1D" ## Request fields (application/json): - `dateTime` (string, required) The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00 - `amount` (object, required) Object containing information regarding the amount being added onto the card or removed from the card. - `amount.total` (number, required) The amount which should be added to the card's balance. Amount cannot be zero. - `amount.checkTotal` (number) Optional field specifying the total amount of the entire bill/invoice that this transaction is part of. It can be larger than in scenarios where the check is being split or if a portion of the check was already paid in cash or another form of payment. - `transaction` (object, required) - `transaction.invoice` (string, required) 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. - `programId` (string) The ID value for the program you are allocating a gift card under. ## Response 200 fields (application/json): - `result` (array) - `result.dateTime` (string) The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm). Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00 - `result.amount` (object) Object containing information regarding the amount being added onto the card or removed from the card. - `result.amount.total` (number, required) For [Activate](/apis/payments-platform-rest/openapi/gift-cards/activate), [Allocate](/apis/payments-platform-rest/openapi/gift-cards/allocate) or [Reload](/apis/payments-platform-rest/openapi/gift-cards/reload) requests, this is the amount which was added to the card's balance. For [Cashout](/apis/payments-platform-rest/openapi/gift-cards/cashout) requests, this is the amount of cash that should be provided to the customer. - `result.card` (object) - `result.card.number` (string) The gift card number that was created during the gift card allocate request. - `result.card.type` (string) An abbreviation used to specify the type of card that was used when processing a transaction. Value| Description -----|------------ GC | Gift Card YC | IT’S YOUR CARD Enum: "GC", "YC" - `result.card.balance` (object) - `result.card.balance.amount` (number) The balance remaining on the card. Depending on which processor is being used, the balance may be returned for a gift card, debit card, EBT card, or other stored value card. - `result.merchant` (object) - `result.merchant.mid` (number) The merchant ID associated with the merchant account. - `result.merchant.name` (string) The merchant’s business name as configured with Shift4. - `result.programId` (string) The ID value for the program you are allocating a gift card under. - `result.server` (object) - `result.server.name` (string) The name of the server that processed the request. - `result.transaction` (object) - `result.transaction.invoice` (string) 10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway. - `result.transaction.responseCode` (string) Code indicating the Shift4 host response. Value | Description | Details -------|---------------------------------------------------------------------------------------|-------- A | Approved | The transaction is approved. C | Approved | The transaction is approved without requiring additional authorization because it is less than or equal to a ceiling amount. (The ceiling amount is the original authorization amount multiplied by the tolerance per the merchant’s settings with Shift4.) D | Declined | The transaction is declined. Note: Shift4 automatically declines AVS/CSC failures if the [POSHANDLEAVSFAIL Api Option](/guides/appendices/api-options#poshandleavsfail) was not sent in the request. e | [Error](/guides/appendices/error-codes) | There is an error condition. f | [AVS or CSC failure](/guides/response-handling/understanding-avs-and-csc-verification)| An AVS or CSC failure has occurred (credit card only). Note: This value will only be returned if the [POSHANDLEAVSFAIL Api Option](/guides/appendices/api-options#poshandleavsfail) was sent in the request. P | [Partial approval](/guides/advanced-concepts/partial-approval) | A partial approval has occurred. Check for the approved amount. R | Voice referral | The transaction requires a voice referral. [blank]| Status is unknown | The approval status is unknown. X | Expired card | There is an error condition due to the card being expired. S | SCA Online PIN required | The contactless EMV transaction requires strong customer authentication to continue. The terminal must gather the online PIN if supported by the device form factor and CVM list then resubmit the transaction request. I | SCA Interface switch required | The contactless EMV transaction requires strong customer authentication to continue. The terminal must look at the form factor indicator to determine if the transaction should be declined, switched to EMV contact or tapped again using CDCVM. Enum: "A", "C", "D", "e", "f", "P", "R", "X", "S", "I" ## Response 400 fields (application/json): - `result` (array) - `result.error` (object) - `result.error.code` (integer) Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details. - `result.error.severity` (string) Severity level of the error. | Severity | Description | | -------- | ---------------------------------------------------------------- | | Info | Action not required - Data input/formatting is incorrect | | Error | Action may be required - Communication, timeout or network issue | | Alert | Action required - System issue | Enum: "Info", "Error", "Alert" - `result.error.shortText` (string) Abbreviated error message that is always returned if an error condition exists - `result.error.longText` (string) Extended error message that is returned if an error condition exists. - `result.error.primaryCode` (integer) Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details. - `result.error.secondaryCode` (integer) This code supplements the code specified in the field to provide additional information about the error that occurred. - `result.server` (object) - `result.server.name` (string) The name of the server that processed the request. ## Response 504 fields (application/json): - `result` (array) - `result.error` (object) - `result.error.code` (integer) Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details. - `result.error.severity` (string) Severity level of the error. | Severity | Description | | -------- | ---------------------------------------------------------------- | | Info | Action not required - Data input/formatting is incorrect | | Error | Action may be required - Communication, timeout or network issue | | Alert | Action required - System issue | Enum: "Info", "Error", "Alert" - `result.error.shortText` (string) Abbreviated error message that is always returned if an error condition exists - `result.error.longText` (string) Extended error message that is returned if an error condition exists. - `result.error.primaryCode` (integer) Code indicating the type of error that occurred. Refer to the [Error Codes](/guides/appendices/error-codes) section of this document for more details. - `result.error.secondaryCode` (integer) This code supplements the code specified in the field to provide additional information about the error that occurred. - `result.lighthouse` (object) - `result.lighthouse.data` (string) Base64 encoded JSON formatted data that will be returned from Lighthouse to be passed back to SkyTab. This data will contain variable information. - `result.server` (object) - `result.server.name` (string) The name of the server that processed the request.