This is API v2 documentation
Welcome to Fourthline's API documentation!
Our APIs are organized around REST. It has resource-oriented URLs, accepts and returns JSON-encoded responses.
It uses:
- Standard HTTP methods, e.g. GET, PATCH, POST, PUT
- HTTP response codes
- Access token authentication
All API requests must be made over HTTPS. Requests made over plain HTTP will fail.
All requests return an immediate response while processing continues asynchronously in our system.
Authentication
Fourthline API uses bearer token authentication. Every request you make must include an access token in the Authorization header.
To obtain an access token, use your Fourthline API key to call the Create access token endpoint.
Environments
Sandbox
You can use the sandbox environment for integration and manual testing. The sandbox environment closely mirrors production, but it is not intended for performance or automated load testing.
https://api.ext-sandbox.fourthline.comProduction
When you go live with your integration, address the production environment.
https://api.fourthline.comResponse codes
The API uses standard HTTP response codes to indicate request success or failure. In general, codes in the:
- 2XX codes indicate success
- 4XX codes indicate an error for the reason provided, e.g. a required parameter was omitted
- 5XX codes indicate a rare Fourthline server error
Not all errors map cleanly onto HTTP response codes. If a valid request fails, e.g. because the country code is not supported, we return a 422 error.
| Response code | Description |
|---|---|
| 200 OK | The request was successful. |
| 201 Created | The request was successful. |
| 202 Accepted | The request was accepted for processing, but processing has not completed yet. |
| 204 No content | The request was successful, but the response returns no body. |
| 400 Bad request | The request was invalid, usually because a required parameter wasn't set. |
| 401 Unauthorized | Your access token is invalid. |
| 403 Forbidden | The request is valid, but our server refuses to respond to it. Unlike a 401 unauthorized response, re-authenticating will not resolve this error. |
| 404 Not found | The resource you requested doesn't exist. Troubleshooting: • Check your credentials and contact your Fourthline delivery manager. • Check your request headers. |
| 405 Method not allowed | The HTTP method you used is not allowed for the resource, e.g. a POST request to a read-only resource. |
| 409 Conflict | We couldn't process the request because there's a conflict in the current state of the resource, e.g. an editing conflict between multiple, simultaneous updates. |
| 422 Unprocessable entity | One or more parameters are syntactically valid but contain invalid values. Troubleshooting: Check your providerProcessId. |
| 429 Too many requests | You have sent too many requests in too short a space of time. |
| 5XX Server error | Something went wrong on our side. |
Testing
We provide a cURL example for each request. You can set the required and optional parameters as relevant, and then test the request from the command line.
OpenAPI specification
To view the OpenAPI specification of Fourthline API:
- Go to OpenAPI.
- Click fourthline-api-v2.yaml or fourthline-webhooks-v2.yaml.
Support
For help getting started, contact your Fourthline delivery manager.