Single Use Codes - 1.0.0
API Endpoints
Single Use Codes
Description: Use this service call to get single use coupon codes for FMTC Merchants.
Example Request: https://s3.fmtc.co/api/1.0.0/single-use-codes?api_token=API_KEY&format=json&merchant_id=MERCHANT_ID
Single Use Codes API
The Single Use Codes endpoint contains a collection of coupon codes that can only be used one time for FMTC Merchants. In order to receive codes for an FMTC Merchant, you will need to have been approved by the Merchant. This information can be used, in combination with our Deals and Merchants endpoints, to ensure that you are using coupon codes only a single time. Codes will only be returned once and will not show up again on another API call.
Request Parameters
Name | Value | Description | Required | Default |
---|---|---|---|---|
api_token | APIKEY | API key for authentication, available on the API Keys & Calls page.(https://account.fmtc.co/cp/api_keys) | Yes | N/A, must always be provided |
format | String XML, JSON | Choose the feed format you would like returned. | Yes | N/A, must always be provided |
merchant_id | Number | Return a single-use code for the particular merchant. | Yes | N/A, must always be provided |
Implementation
Response Elements
Name | Description |
---|---|
code | The coupon code listed as a single use code. |
message | Will be filled if there is a message to be passed with the single use code. For example:
|
Example Response - JSON
Here is an example of a JSON Response from the Single Use Codes endpoint.
{
"data": [
{
"code": "TESTCODE123121-00001",
}
]
Example Response - XML
Here is an example of an XML Response from the Single Use Codes endpoint.
<results>
<data>
<single-use-code>
<code>TESTCODE123121-00001</code>
</single-use-code>
</results>
Example Error Response
JSON
Example:
{
"errors": {
"merchant_id": [
"The merchant_id field is required."
]
}
}
XML
Example:
<response>
<errors>
<merchant_id>
<merchant_id>The merchant_id field is required.</merchant_id>
</merchant_id>
</errors>
</response>
Error Responses
Parameter Key | Error String | Description |
---|---|---|
format | The requested format is invalid or not supported. | The format parameter string is either not valid or not supported. Please double check the provided format request parameter is valid and supported by the API endpoint. |
merchant_id | The merchant_id field is required. | The merchant_id field is not passed in or not a valid number. Please double check that you are passing in a valid number. |