API Requests

To make a REST API request, you combine the HTTP GET, POST, PUT, PATCH, or DELETE method, the URL to the API service, the URI to a resource to query, submit data to, update, or delete, and one or more

The URL to the API service is either:

  • Sandbox: https://sandbox.smartfastpay.com

  • Live: https://api.smartfastpay.com

Optionally, you can include query parameters on GET calls to filter, limit the size of, and sort the data in the responses.

Most GET, POST, PUT, and PATCH calls require a JSON request body.

This sample request oauth token

curl -v --location --request POST https://sandbox.smartfastpay.com/oauth2/token \
  --header 'Accept: application/json' \
  --header 'Authorization: Basic <EncodedClientIdClientSecret>' \
  --header 'Content-Type: application/json'

This sample request lists transactions:

curl -v --location --request GET 'https://sandbox.smartfastpay.com/transactions' \
        --header "Content-Type: application/json" \
        --header "Authorization: Bearer <Access-Token>"

Query parameters

For most REST GET calls, you can include one or more query parameters on the request URI to filter, limit the size of, and sort the data in an API response. For filter parameters, see the individual GET calls.

To limit, or page, and sort the data that is returned in some API responses, use these, or similar, query parameters:

Note: Not all pagination parameters are available for all APIs.

For example, the Transaction API returns details for ten transactions starting with the second page sorted by descending id in the response:

curl -v --location --request GET 'https://sandbox.smartfastpay.com/transactions?limit=10&page=2&sort=id,desc' \
        --header "Content-Type: application/json" \
        --header "Authorization: Bearer < Access-Token >"

HTTP request headers

The commonly used HTTP request headers are:

Content-Type

The response format, which is required for operations with a response body. The syntax is:

Content-Type: application/format

Where format is json.

Authorization

Required to get an access token or make API calls:

  • Get an access token

    When you create a sandbox or live REST API app, SmartFastPay generates a set of OAuth 2.0 client ID and secret credentials for the sandbox or live environment. When you make a get an access token call, set the Authorization header to these credentials for the environment in which you're making the call.

    In exchange for these credentials, the SmartFastPay authorization server issues a bearer access token that you use for authorization when you make REST API requests.

    A bearer token enables you to complete actions on behalf and with the approval of the resource owner.

  • Make REST API calls

    Include the access token in the Authorization header with the Bearer authentication scheme:

    Authorization: Bearer <Access-Token>

Last updated