Documentation - Arcus APIv3.3

Welcome to Arcus API, this is its full documentation. Here, you will find detailed information about Arcus API. This documentation goes hand in hand with the endpoints site. It contains information about each endpoint and it is the best way to know what you have to send and what you will receive for every request you perform.

Environments

Arcus will provide you with separate API keys for our two existing environments:

  • Sandbox. Arcus maintains a Sandbox which allows developers to test the API using mocked data. We recommend keeping in mind the following: The list of billers is not in sync with the billers in production.

    To make requests to sandbox environment, use the following URL: https://api.staging.arcusapi.com

  • Production. Once you have completed all the necessary tests on the sandbox, contact us to receive your production keys.

    To make requests to the production environment, use the following URL: https://api.arcusapi.com

Note: Timeout for all request is 60 seconds.
Note: Before we provide you a key pair for production environment, your integration needs to be certified. For more information about certification process, contact with Arcus Latin America Technical Support.

Security

To make requests to our endpoints, you must use the HTTPS protocol, regardless of the environment you're using.

Note: For security reasons, our API only supports TLS v1.2 o newer.

Security HTTP Headers

All responses return the following security headers.

  • X-Frame-Options
  • X-Content-Type-Options
  • Strict-Transport-Security
  • Content-Security-Policy
  • Referrer-Policy
  • Cache-Control
  • Feature-Policy
  • Cross-Origin-Embedder-Policy
  • Cross-Origin-Resource-Policy
  • Cross-Origin-Opener-Policy

Authentication

The Arcus API has a special form of authentication, which is based on the path and HTTP headers of every request that is performed. Each request must contain the following headers:

  • Accept MIME type which is acceptable for the response.
    For all your requests, you will always send application/vnd.regalii.v3.3+json
  • Content-Type Indicates the MIME type of the entity-body sent to the recipient.
    You will always send application/json.
  • Date Represents the date and time at which the message was originated. This header format is specified in RFC 822 Section 5.
    For example: Wed, 01 Aug 2018 17:26:52 GMT
  • Authorization Authentication credentials, this header has the following form:
    APIAuth <your-api-key>:<checksum>
  • Content-MD5 (optional). It's an MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) of the entity-body.
Note: Requests are valid for 15 minutes, so, set Date header with current date-time.

As it is indicated by its description, Authentication header is the way to authenticate in the Arcus API, it's composed of the following pair: your API key and a checksum built from the endpoint, the HTTP headers and your secret key.

In the next section, you will learn how to calculate <checksum> for all your API requests.

Calculating the checksum

Step 1

A checksum string (<checksum-string>) is first created using the following HTTP request headers

  • Content-Type
  • Content-MD5
  • Date

And the Endpoint that you want to access. This checksum string has the following form:

<checksum-string> = "<Content-Type>,<Content-MD5>,<Endpoint>,<Date>"

For example:

<Content-Type> = "application/json"
<Content-MD5>  = ""
<Endpoint>     = "/account"
<Date>         = "Wed, 01 Aug 2018 17:26:52 GMT"

then it produces:

<checksum-string> = "application/json,,/account,Wed, 01 Aug 2018 17:26:52 GMT"

Step 2

<checksum> is an HMAC encoded in Base64. The HMAC uses SHA-1 as hash function and <your-secret-key> as cryptographic key.

You can use OpenSSL to calculate the checksum. In shell:

echo -n "<checksum-string>" \
  | openssl dgst -sha1 -binary -hmac "<your-secret-key>" \
  | base64

For example. If:

<checksum-string> = "application/json,,/account,Wed, 01 Aug 2018 17:26:52 GMT"
<your-secret-key> = "your-secret-key"

then it produces: PbYMLSKsXhplSStqyySn63UFEc8=

Make a call to /account endpoint to check your credentials.

Note: If you set URL's query string, don't forget encode it (see RFC1738 Section 2.2). Keys and values must be encoded to application/x-www-form-urlencoded MIME format (see Percent-encoding).

How to make an API call

The endpoint /account will retrieve your account information. It is an excellent way to learn how to make requests to Arcus For this example, we are going to use curl tool.

In a shell script file write step 1 and 2:

1. Generate the checksum replacing <your-secret-key> with the secret key provided by Arcus.

CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'`
CHECKSUM=$(echo -n "application/json,,/account,$CURRENT_DATE" \
  | openssl dgst -sha1 -binary -hmac "<your-secret-key>" \
  | base64)

2. Send you request to desired environment. Replace <your-api-key> with the API key provided by Arcus.

curl -X GET "https://api.staging.arcusapi.com/account" \
  -H "Accept: application/vnd.regalii.v3.3+json" \
  -H "Content-Type: application/json" \
  -H "Content-MD5:" \
  -H "Date: $CURRENT_DATE" \
  -H "Authorization: APIAuth <your-api-key>:$CHECKSUM"

3. Execute the script. The server will respond with a JSON object. Use this information in according your needs.

{
  "name" : "John Smith",
  "balance" : 956.33,
  "minimum_balance" : 81645.24
}

Country codes, currency codes and date-time format conventions

Country and currency codes as well as date-time form used throughout this API are standardized in accordance with ISO Standards.

  • Country codes: ISO 3166-1 alpha-2. For example,MX code matches with Mexico.
  • Currency codes: ISO 4217. For example,MXN code matches with Mexican Peso.
    Note: ISO publishes the currency codes in XML and XLS form.
  • Date-time form: Date-time is stored in ISO/WD 8601 YYYY-MM-DDThh:mm:ssZ format (This matches to Extended complete representation of Date and time of day format).
    Example: If you execute a payment on July 16th, 2018 at 12:47:57 in Mexico City, it's saved as 2018-07-16T17:47:57Z.

Caching data

To ensure that your customers are able to leverage the enhancements that we make over time, you are required to cache the full list of billers and update it on a weekly basis. To perform this task, Arcus provides a list of billers in the endpoints provided. Sync this information with your local database.

Endpoints:

  • GET /billers/utilities
  • GET /billers/topups
  • GET /billers/arcuspay

We disclose to you the exchange rates that will be applied for the bill. These rates change on a daily basis at 5AM EST. You are required to cache them each morning between 6-7AM EST.

Endpoints:

  • GET /rates

Pagination

Some endpoints like /billers/*, /bills and /transactions have large results and these results are partitioned in pages. Handle pagination by using the X-Pagination header and requesting subsequent pages. For more information, consult pagination model in endpoints site.

Payment Types

There are 4 payment workflows based on the biller’s options:

  • can_check_balance
  • supports_partial_payment

can_check_balance supports_partial_payments Action
true false When balance lookup is supported and no partial payments are supported, we require you to force the user to lookup the balance prior to making a payment.
true true When balance lookup and partial payments are supported, balance lookup is optional. The user should be able to choose to pay whatever amount they like.
false true When balance lookups are not supported and partial payments are supported, the user should be able to enter whatever amount they like.
false false When balance lookups are not supported and no partial payments are supported, the user should be able to enter whatever amount they like, but it is client's responsibility to cover the entire amount.

Webhooks

Arcus offers webhooks which can be used to notify you when there are updates to a bill or transaction.

When are Webhooks Sent?

Webhooks are sent when there are changes in a bill object:

  • the bill has been re-run by Arcus due to an earlier error or outage
It is the client's responsibility to trigger bills to refresh under normal operation.

How to Register a Webhook?

You can set up a webhook URL with Arcus by contacting us.

Data in Webhook

Webhooks return the same data returned when you create a bill or transaction.

Dealing with timeouts

Timeouts from calling our server are rare but can happen periodically. You can deal with timeouts in bill's creation and payment.

Creation timeout

Bills can't be duplicated, so any request to create again a bill is going to response with the previous bill created.

Payment timeout

All calls to POST /bills/{id}/pay should include an external_id parameter that corresponds to a generated unique id in your system, which will be stored with a successfully processed transaction. We recommend use UUID for this field.

If a timeout happens, make a call to GET /transactions with query parameter q[external_id_eq], include the sent external_id to payment endpoint. If you get data, the request was received by Arcus. Otherwise, perform the payment again.

Integration

Please test your integration by making calls to our sandbox.

All calls made to the sandbox environment are mocked so there is an expected outcome for all scenarios. Because all responses on the sandbox server are fake, feel free to make every possible request that you need to test.

The goal of this section is to ensure that you have handled all of the different scenarios that may arise.

.

Authentication + First Request

Goal

Grab information about your account.

References:

Correct authentication headers are required to gain access to the Arcus API. You can build a well-formed curl command in our endpoints site.

However, if you want to implement it by yourself, follow the steps described in the Authentication section.

Perform:
Method URL Request body
GET https://api.staging.arcusapi.com/account None
Success:
  • Provide the balance returned.

Syncing billers

Goal

Cache the information about the billers that Arcus provides. Update the billers listed in your database with the endpoints provided.

References
  • Utility billers
  • Top-up billers
  • Arcuspay billers
Perform
Method URL Request body
GET https://api.staging.arcusapi.com/billers/utilities None
GET https://api.staging.arcusapi.com/billers/topups None
GET https://api.staging.arcusapi.com/billers/arcuspay None
Success
  • Verify that the number of billers in your local database is the same number of records returned in the billers feed.
  • Verify that all billers are accessible for the client in the UI.
  • Verify that there is a quick way to filter the billers listing.
  • Handle pagination by using the X-Pagination header and requesting subsequent pages.

Linking bill: Creation

Goal

Create a bill in Arcus with an account number. Account number bills are mostly to make payments without providing personal information.

References:
  • Bill creation endpoint
Perform:
Method URL Request body
POST https://api.staging.arcusapi.com/bills
{
  "biller_id": 8925,
  "account_number": "1234567"
}

Success:
  • Receive a 200 response
  • Get the id of the Bill
  • Get the status of the Bill (linked)

Retrieve all bills

Goal

Retreive data of all bills

References:
  • Bills get endpoint
Perform:
Method URL Request body
GET https://api.staging.arcusapi.com/bills None

Success:
  • Response has 200 status code.
  • Handle pagination by using the X-Pagination header and requesting subsequent pages.

Show a bill

Goal

Retreive data of a specific bill

References:
  • Bill show endpoint
Perform:
Method URL Request body
GET https://api.staging.arcusapi.com/bills/<bill_id> None

Success:
  • Response has 200 status code.
  • Bill data.

Bill's extended data

Goal

Get additional info of a bill, use this endpoint according with bill's field has_xdata.

References:
  • Bill xData endpoint
Perform:
Method URL Request body
GET https://api.staging.arcusapi.com/bills/<bill_id>/xdata None

Success:
  • Response has 200 status code
  • Bill with extra info.

Refreshing a bill

Goal

Take a bill (or link a new one) and refresh its balance.

References:
  • Bill refresh endpoint
Perform:
Method URL Request body
POST https://api.staging.arcusapi.com/bills/<bill_id>/refresh None

Success:
  • Response has 200 status code
  • Verify balance has changed (remember numbers are random on staging)

Destroy a bill

Goal

Destroy a bill given its ID.

References:
  • Bill delete endpoint
Perform:
Method URL Request body
DELETE https://api.staging.arcusapi.com/bills/<bill_id> None

Success:
  • Response has 200 status code.
  • All data associated with the bill.
  • A call to GET /bills will not show this bill.

Payments (optional)

This section only needs to be completed if you plan to pay bills via the Arcus API.

Goal

Successfully pay a bill for a client.

References
  • Pay bill
Perform:
Method URL Request body
POST https://api.staging.arcusapi.com/bills/<bill_id>/pay
{
  "amount": <amount>,
  "currency": "<currency>",
  "external_id": "<uuid>"
}

Success:

You receive a 200 response and the payment confirmation.

Reconciliation

Payments

To reconcile your transactions with Arcus, you must upload a file to us EACH MORNING BETWEEN 4 AM CST and 5 AM CST with the list of the previous day’s transactions, even if you didn't perform payments.

Directions
  1. Upload a file of the format specified below to our SFTP server at 4 AM CST. We will process the record and reconcile it against the records that we have on our own server and send you back the results at 5 AM CST.
  2. The file should have 1 entry for every transaction performed by your chain from midnight to midnight CST of the previous day. It’s very important to take daylight saving times into consideration, as Arcus adjusts automatically to CDT.
    Differences in timezones when generating transaction files might result in reconciliation differences. The file should be uploaded every day of the week, including weekends.
  3. If you don't have transactions, the file will only contain the header and the footer with 0 registers count.
  4. The conciliation results’ email will describe the differences between our records calling out the transactions included in the uploaded file that were present in our records and the transactions in our records that were not included in your file.
  5. The credentials for the SFTP server will be provided during certification process.
File specification

This is an example of a reconciliation file. The file describes the transactions performed by a chain of name chain, that did 2 transactions on Aug 8 2018.

HEADER|20180809
REGISTER|2018-08-08T17:09|40|177467|501000000007|185.00|MXN|S12C03|bcc2263d-9918-4df9-b948-035c60c81cce
REGISTER|2018-08-08T19:25|40|177468|501000000008|968.00|MXN|S12C03|635f468c-0dc1-4f50-83c6-04471bdf726f
FOOTER|2
File name

Reconciliation filename should be on the following layout:

chainname_YYYYMMDD.txt

Where:

  • chainname: Chain name
  • YYYYMMDD: DateTime when the file is created in UTC. Where:
    • YYYY: year in 4 digits
    • MM: Month of the year, zero-padded
    • DD: Day of the month, zero-padded
File format

The conciliation file, is a pipe separated file with the following format. Use a vertical bar | as field separator.

1. First line should be a header, with the date of creation.

Field Description
HEADER Indicate this is a header line
YYYYMMDD Date when the file is created:
  • YYYY: Year in 4 digits
  • MM: Month of the year, zero-padded
  • DD: Day of the month, zero-padded

2. After the Header line, you should include zero or more Register lines, each line should contain the information of one transaction in the following layout.

Field Description
REGISTER Indicate this is a register line
creation DateTime Transaction’s creation DateTime in UTC in format yyyy-MM-ddTHH:mm:ss
biller id (SKU) Transaction’s biller_id
authorization Transaction’s authorization, this is the field id returned on a successful /bills/{id}/pay request
account number Transaction account_number
amount Transactions amount in local currency, same amount sent on /bills/{id}/pay request. It should include decimal point and 2 decimals
amount currency Transaction currency, same currency send at /bills/{id}/pay request
pos number pos_number send on /bills/{id}/pay request. If you did not send this parameter, its field must be empty (no whitespace).
external id external_id send on /bills/{id}/pay request

3. The last line of the file is Footer line, it contains a summary of all transactions with the following format.

Field Description
FOOTER Indicate this is a footer line
Transactions count Number of transactions included on the file, should be the same number of REGISTER lines. If you do not have transactions to reconcile, the counter is 0.

Cash out

Goal

Perform a Cash out to an account.

Perform:
Method URL Request body
POST https://api.staging.arcusapi.com/single/cash_out
{
  "biller_id": 13621,
  "account_number": "256863285",
  "amount": 12.21,
  "currency": "MXN",
  "external_id": "84bce950-c878",
  "pos_number": "S12C03",
  "cashier_id": "CASH956"
}

Success:
  • Receive a 200 response

Error codes

HTTP Error codes

The Arcus API uses the following HTTP status error codes.

CodeStatusDescription
200OKThe request was successful.
400Bad RequestSomething is wrong in the request.
401UnauthorizedYour API key or checksum is wrong, or your IP is not on whitelist in production environment.
403ForbiddenYou are not authorized to access the resource requested.
404Not FoundThe specified resource could not be found.
429Too Many RequestsYou’re sending too many requests! Slow down!
500Internal Server ErrorWe had a problem with our server. Try again later.
503Service UnavailablePlease try again later.

Arcus API error codes

CodeMessage
R1Invalid number of digits in account number
R2Invalid Account Number
R3Invalid Payment Amount
R4Account number does not resolve with biller
R5Invalid Phone Number
R6Invalid Biller
R7Account Number is valid but cannot receive payments like this
R8Balance has already been paid
R9Unexpected error (everything entered was correct)
R10Incorrect Biller for the Provided Account Number
R11Invalid Payment Amount: You must pay the full amount balance
R12Payment Already Made
R13Name on account is required
R14Payment amount too large, max amount is 1500 USD
R15Account Balance is 0
R16Failed to make the consult, please try again later
R17Invalid Top-up amount
R18Top-up daily limit exceeded
R19Payments with this biller are currently unavailable
R20Lookup time out with biller
R21Configuration issue between us and our biller
R22Biller maintenance in progress, please try again later
R23No transaction to reverse
R24Timeout from biller
R25Error with performing the cancellation
R26Reversal not supported for this biller
R27Overdue Bill
R28Invalid Account Number: Sky account numbers should start with 401 or 501 or 601
R29The biller returned an error. Please check the account number.
R30Different company
R31Phone number is no longer active
R32Invalid Payment Amount: Sky minimum payment is $ 185 MXN
R33Fraud suspected
R34Invalid Currency
R35Temporary communication error with carrier. Please try again
R36Blocked attempt to make a possible duplicate payment. Requests for this account number with this payment amount are blocked for 1 hour
R37Recurring payments enabled for this account
R41Invalid Payment Amount: You must pay at least the actual account balance
R42Account Number is valid, but is postpaid and doesn’t have balance yet
R43Invalid Barcode Format. Please the payment with the account number
R44Invalid Customer Status. This customer is required to show in person at the Biller location
R45The maximum number of payments for this account on this day was reached
R46Can't get balance. This customer is required to show in person at the Biller location.
R47No connection with the billerUnable to perform operation, biller returned an unexpected error
R48Unable to perform operation, biller returned an unexpected error
R49Transaction ID previously used, There is already an operation linked to the transaction id
R50Blocked attempt to prevent a possible duplicate transaction. Please try again in 5 minutes.
R99Catchall error
R100Insufficient balance. Make a call to /account to get your current balance
R101Biller doesn’t support balance lookup
R102Invalid or missing parameters
R103Transaction already reversed
R104Invalid Subscription ID. Please verify the ID that you passed or create a new subscription
R105Only same day reversals are allowed
R106Exceeded the time allowed to reverse the transaction
R114Payment amount too large, max amount is 2500 USD
R115POS number is invalid
R117Company is not assigned
R118Biller doesn't support autopay
R119Biller doesn't support balance tracking
R121Balance lookup issue
R122Balance not yet available for this biller
R124Company doesn't support cash out
R125Company doesn't support deposit
R126Transacción no realizada por haber excedido su límite permitido. Acuda a una sucursal bancaria.
R127Transacción no realizada.
R200Processor OK
R201Processor Access Denied
R202Processor does not return balance
R299Catchall Processor error
As a Regulated Financial Entities for the CASH IN service, it is mandatory include the error codes R126 & R127 according to the law and the regulations established by “Banco de México” through the Comisión Nacional Bancaria y de Valores (Article 323, section I and II, subparagraph "a" and "b").