API Cookbook

You will find here different cookbooks that will allow you to understand our API step by step.

Version : 1.0

How to get the statements of your accounts and cards ?

Step 1: Identification

Please refer to our API documentation to identify.

Step 2: Retrieve the list of accounts associated to a token

curl -G "https://ws-sandbox.anyti.me/v1.0/accounts" \
-X GET \
-H 'Authorization: Bearer [THE_TOKEN]' \
-H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
-H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]'
Response example:
{
  "request_id": 90467,
  "type_response": "sync",
  "timestamp": 1487587813.6616,
  "hash": "9761e581fe59d0cdc339dd15d7cb93a52b79f9d30c62c66235d99271326fe1fc",
  "body": {
    "accounts": [
      {
        "acc_id": "1",
        "acc_type": "business"
      },
      {
        "acc_id": "2",
        "acc_type": "business"
      }
    ]
  }
}

Step 3: Retrieve the statements associated to an account

curl -G "https://ws-sandbox.anyti.me/v1.0/accounts/{id}/statements" \
-X GET \
-H 'Authorization: Bearer [THE_TOKEN]' \
-H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
-H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]'
Response example:
{
  "request_id": 90469,
  "type_response": "sync",
  "timestamp": 1487588031.5868,
  "hash": "de877e18b5a66a7bf6580fa9441a0abe44d278b94ffde09095307effb1719667",
  "body": {
    "acc_id": "1",
    "acc_type": "business",
    "acc_currency": "EUR",
    "corp_name": "The corp name",
    "corp_regnum": "00000000",
    "corp_type": "SA",
    "corp_activity": "Consulting",
    "corp_tva": "BE0123456789",
    "corp_addr_1": "Examplestreet 1",
    "corp_addr_2": "",
    "corp_zip": "1050",
    "corp_city": "Ixelles",
    "corp_cc": "BE"
  }
}

Step 4: Retrieve the cards list of an account

curl -G "https://ws-sandbox.anyti.me/v1.0/accounts/{id}/cards" \
-X GET \
-H 'Authorization: Bearer [THE_TOKEN]' \
-H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
-H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]'
Response example:
{
  "request_id": 90470,
  "type_response": "sync",
  "timestamp": 1487588703.9502,
  "hash": "bb74dbfd17b1233920398c437cf6b36eb9d0b98bdc140cab820e65c1ee92e3b9",
  "body": {
    "acc_id": "1",
    "cards": [
      {
        "card_ref": "ANY1234567890",
        "status": "1",
        "activation_date": "2016-04-20",
        "balance": "-71880.74",
        "expiry_date": "2018-10-04",
        "atm": "1",
        "pos": "1",
        "card_holder": {
          "gender": "F",
          "first_name": "Firstname",
          "last_name": "Lastname"
        }
      },
      {
        "card_ref": "ANY1234567891",
        "status": "1",
        "activation_date": "2015-03-02",
        "balance": "-16645.43",
        "expiry_date": "2018-06-04",
        "atm": "1",
        "pos": "1",
        "card_holder": {
          "gender": "F",
          "first_name": "Firstname",
          "last_name": "Lastname"
        }
      }
    ]
  }
}

Step 5: Retrieve the statements for a card

curl -G "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}/transactions" \
-X GET \
-H 'Authorization: Bearer [THE_TOKEN]' \
-H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
-H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]'
Response example:
{
  "request_id": 90471,
  "type_response": "sync",
  "timestamp": 1487588973.7973,
  "hash": "29d2e287542fdc0ad5341eca2ff4034ae6101292cd83b32f5bc47fefb768071d",
  "body": {
    "date_time": "2017-02-20 12:09:33",
    "filters": {
      "limit_start": 0,
      "limit_number": 50
    },
    "card_ref": "ANY7622465500",
    "acc_id": "1",
    "transactions": [
      {
        "txid": "8",
        "mcc": "3",
        "amount": 9194.50,
        "amount_fx": 9194.50,
        "currency": "EUR",
        "fx": "1.000000",
        "fx_fee": 0,
        "status": "S",
        "type": "C",
        "balance_after": "38619.50",
        "date": "2016-07-03 08:37:27",
        "description": "Some description"
      },
      {
        "txid": "9",
        "mcc": "1",
        "amount": 3741.61,
        "amount_fx": 3741.61,
        "currency": "EUR",
        "fx": "1.000000",
        "fx_fee": 0,
        "status": "S",
        "type": "C",
        "balance_after": "29798.50",
        "date": "2016-08-13 15:27:34",
        "description": "Some description"
      }
    ]
  }
}

How to create virtual single use cards ?

Step 1: Identification

Please refer to our API documentation to identify.

Step 2: Order the card

You have to order a card by using the method below.
You must set the parameter card_type to VIRTUAL_SINGLE_USE.

curl "https://ws-sandbox.anyti.me/v1.0/cards" \
    -X POST \
    -H 'Authorization: Bearer [THE_TOKEN]' \
    -H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
    -H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]' \
    -d 'acc_id=integer' \
    -d 'card_name=string' \
    -d 'card_type=VIRTUAL_SINGLE_USE' \
    -d 'expiry_date=string' \
    -d 'amount=number' \
    -d 'language=string' \
    -d 'delivery_company_name=string' \
    -d 'delivery_gender=string' \
    -d 'delivery_first_name=string' \
    -d 'delivery_last_name=string' \
    -d 'delivery_addr_1=string' \
    -d 'delivery_addr_2=string' \
    -d 'delivery_zip=string' \
    -d 'delivery_city=string' \
    -d 'delivery_cc=string'
Response example:
{
  "request_id": 90482,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "order_status": 3,
    "order_id": 36,
    "card_ref": "ANY9469919999",
    "date_time": "2017-02-23 10:36:14"
  }
}

Step 3: Send the pan to the card holder

You have to send the pan to the card holder by using the method below
You have to set the parameter dest_method to email or sms.

curl "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}/pan" \
    -X POST \
    -H 'Authorization: ' \
    -H 'X-Validation-Data: ' \
    -H 'X-Signed-Request: ' \
    -d 'dest_method=string' \
    -d 'dest_value=string'
Response example:
{
  "request_id": 90484,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "state": "success"
  }
}

Step 3 bis: Get the pan

You can also get the pan directly in the API response by using the card get pan API.

curl "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}/pan" \
    -X GET \
    -H 'Authorization: ' \
    -H 'X-Validation-Data: ' \
    -H 'X-Signed-Request: '
Response example:
{
  "request_id": 90484,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "expiry_date": "string",
    "pan": "string",
    "cvv": "string"
  }
}

How to create virtual multi use cards ?

Step 1: Identification

Please refer to our API documentation to identify.

Step 2: Order the card

You have to order a card by using the method below.
You must set the parameter card_type to VIRTUAL_MULTI_USE.

curl "https://ws-sandbox.anyti.me/v1.0/cards" \
    -X POST \
    -H 'Authorization: Bearer [THE_TOKEN]' \
    -H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
    -H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]' \
    -d 'acc_id=integer' \
    -d 'card_name=string' \
    -d 'card_type=VIRTUAL_MULTI_USE' \
    -d 'expiry_date=string' \
    -d 'amount=number' \
    -d 'language=string' \
    -d 'delivery_company_name=string' \
    -d 'delivery_gender=string' \
    -d 'delivery_first_name=string' \
    -d 'delivery_last_name=string' \
    -d 'delivery_addr_1=string' \
    -d 'delivery_addr_2=string' \
    -d 'delivery_zip=string' \
    -d 'delivery_city=string' \
    -d 'delivery_cc=string'
Response example:
{
  "request_id": 90482,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "order_status": 3,
    "order_id": 36,
    "card_ref": "ANY9469919999",
    "date_time": "2017-02-23 10:36:14"
  }
}

Step 3: Send the pan to the card holder

You have to send the pan to the card holder by using the method below
You have to set the parameter dest_method to email or sms.

curl "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}/pan" \
    -X POST \
    -H 'Authorization: ' \
    -H 'X-Validation-Data: ' \
    -H 'X-Signed-Request: ' \
    -d 'dest_method=string' \
    -d 'dest_value=string'
Response example:
{
  "request_id": 90484,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "state": "success"
  }
}

Step 3 bis: Get the pan

You can also get the pan directly in the API response by using the card get pan API.

curl "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}/pan" \
    -X GET \
    -H 'Authorization: ' \
    -H 'X-Validation-Data: ' \
    -H 'X-Signed-Request: '
Response example:
{
  "request_id": 90484,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "front": "string",
    "back": "string"
  }
}

How to create plastic card ?

Step 1: Identification

Please refer to our API documentation to identify.

Step 2: Order the card

You have to order a card by using the method below.
You must set the parameter card_type to PLASTIC.

Note that when you call this method, it will trigger a card order request. The request will be manually checked by Anytime and the card will be sent to the customer once accepted. To know how to check the status of the card, read the step 3.

curl "https://ws-sandbox.anyti.me/v1.0/cards" \
    -X POST \
    -H 'Authorization: Bearer [THE_TOKEN]' \
    -H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
    -H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]' \
    -d 'acc_id=integer' \
    -d 'card_name=string' \
    -d 'card_type=PLASTIC' \
    -d 'expiry_date=string' \
    -d 'amount=number' \
    -d 'language=string' \
    -d 'delivery_company_name=string' \
    -d 'delivery_gender=string' \
    -d 'delivery_first_name=string' \
    -d 'delivery_last_name=string' \
    -d 'delivery_addr_1=string' \
    -d 'delivery_addr_2=string' \
    -d 'delivery_zip=string' \
    -d 'delivery_city=string' \
    -d 'delivery_cc=string'

Step 3: Check the card status

You can check the card status whenever you want

curl "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}" \
    -X GET \
    -H 'Authorization: Bearer [THE_TOKEN]' \
    -H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
    -H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]'

How to activate a plastic card ?

Step 1: Identification

Please refer to our API documentation to identify.

Step 2: Activate the card

You have to activate your plastic card by using the method Card Update.
You must set the parameter card_status to ACT.

curl "https://ws-sandbox.anyti.me/v1.0/cards/{card_ref}" \
    -X PUT \
    -H 'Authorization: Bearer [THE_TOKEN]' \
    -H 'X-Validation-Data: [VALIDATION_DATA_STRING]' \
    -H 'X-Signed-Request: [X_SIGNED_REQUEST_STRING]' \
    -d 'card_status=ACT'
Response example:
{
  "request_id": 90482,
  "type_response": "sync",
  "timestamp": 1487842574.9273,
  "hash": "e91745ff9f3119d70021d2132ae9cf7f8175e9b2a724dd33fb397a9a6c001fac",
  "body": {
    "card_ref": "ANY9469919999",
    "status": "ACT",
    "pos": 1,
    "atm": 1,
    "renew": 0
  }
}