battleface Partner API

Number of APIs: 48

General Points

• The API conforms to the REST architecture.
• Data sent in the request and response bodies are encoded in JSON.
• Request must be performed from a registered IP.
• Access to the API is controlled via a JWT token which will be provided to you.
• All requests must include these two required HTTP headers:

KeyValue
Content-Typeapplication/json
AuthorizationBearer

Error Handling

General Information

HTTP status codes are used to determine whether an API call has been successful. If the status code is in the form of 2xx this would signify that the call was successful. Any other status code would mean that the call was unsuccessful.

Error Codes

400

Premium does not match or sanction search failed.

{
    “error”: “Different premium value provided.”
}

401

This is returned in case of an unauthorised access to a resource. The reason for this can vary from the token being invalid to trying to access a resource that the token is not allowed to access. Make sure that the token that you are using has been copied fully in the Authorization header. Example of an error returned is the following:

{
    “error”: “Expired or Invalid JWT Token.”
}

401

This is mostly returned if the URL of the request is incorrect.

406

This signifies that data sent in the request is incorrect. Go through the documentation for the call and make sure that the request body parameters meet the criteria mentioned. Example of an error received is the following:

{
    “error”: “Product ID not provided.”
}

422

Payment error.

{
    “error”: “Incorrect card details.”
}

5xx

This is a server related error and this should not be a common occurrence. If this is encountered, please contact it@battleface.com

Product Reference

Please see the product reference section in the applicable product collection.

Actions Reference

Action DescriptionAction ID
Store Order & Process Payment, do not send policy & welcome emails
Card details are required in payload
process_payment_without_email
Store Order & Process Payment, send policy & welcome emails
Card details are required in payload
process_payment_with_email
Store Order only, do not send policy & welcome emails
Card details are not required in payload
storage_only_without_email
Store Order only, send policy & welcome emails
Card details are not required in payload
storage_only_with_email
  1. API-Related Data - Countries GET {{host_gateway}}/api/partner/product/{{api_product_id}}/countries

  2. API-Related Data - Country Product Currency Exception Show GET {{host_gateway}}/api/product/{{product_id}}/country-product-currency-exception/country/{{country_id}}/currency/{{currency_id}}

  3. API-Related Data - Country Product Currency Exception Index GET {{host_gateway}}/api/product/{{product_id}}/country-product-currency-exception

  4. API-Related Data - Host Countries GET {{host_gateway}}/api/partner/product/{{api_product_id}}/host-countries

  5. API-Related Data - Destination Countries GET {{host_gateway}}/api/partner/product/{{api_product_id}}/destination-countries

  6. API-Products-battleface Discovery Product-Packages - Optional - Product Packages By Host Country GET {{host}}/api/partner/product/{{product_id}}/host-country/{{host_country_id}}/packages

  7. API-Related Data - Product Packages State GET {{host_gateway}}/api/partner/product/{{api_product_id}}/host-country/{{host_country_id}}/host-country-state/{{host_country_state_id}}/packages

  8. API-Claims-Options - States GET {{claim_api_host}}/countries/{{country_code}}/states

  9. API-Related Data - Product Packages By State GET {{host_gateway}}/api/partner/product/{{api_product_id}}/country/{{country_code}}/country-state/{{state_code}}/packages

  10. API-Related Data - Product Packages Country GET {{host_gateway}}/api/partner/product/{{api_product_id}}/host-country/{{host_country_id}}/packages