NAV Navbar
API Reference

Introduction

API Production Endpoint

https://api.everypay.gr

API Sandbox Endpoint

https://sandbox-api.everypay.gr

This documentation will guide you through EveryPay REST API in order to show you how to authenticate, make requests, and retrieve data. Our API accepts form-encoded request bodies and returns responses in JSON format.

Authentication

Example authentication request

$ curl https://api.everypay.gr/payments \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: 

All requests to EveryPay API have to be authenticated and have to be made over HTTPS. Our API uses HTTP Basic Auth for authentication.

To authenticate you need to provide your API secret key, as username and leave the password blank. Some REST clients expect a username:password pair separated by a colon. Since there is no explicit password with the API key, it will need to be followed simply by a colon in those cases.

You can find you API keys in your account settings once you login to your account. Please keep your private keys secure and don’t pass them to anyone. These private keys have extreme secure information for handling the transactions of your account.

Errors

Error response example

{
    "error": {
        "status": 401,
        "code": 10000,
        "message": "Please provide a valid API key"
    }
}

The EveryPay API uses HTTP Status codes to reflect successful or error requests. 2XX status codes represent a successful request, 4XX/5XX status codes represent an error took place. If you receive an error HTTP status code, check the body for an error code and message.

Status Code Description Most Likely Cause
200 OK Successful request
400 Bad Request Request has invalid data or is missing a required field
401 Unauthorized Provided API key is missing or invalid
402 Payment Failed Request was valid but card processing has failed
404 Not Found Requested object was not found
409 Conflict The request conflicts with another request
500 Server Error Something wrong happened on our side
Resources

Payments

Payments are charges made with a payment card (credit, debit, prepaid).

The payment object

The payment object

{
    "token": "pmt_lkPJrywRlDAp5oKrqOeRHEt0",
    "date_created": "2019-02-14T19:47:03+0200",
    "description": "Order #GGA-435167",
    "currency": "EUR",
    "status": "Captured",
    "amount": 1000,
    "refund_amount": 0,
    "fee_amount": 48,
    "payee_email": null,
    "payee_phone": null,
    "merchant_ref": null,
    "card": {
        "token": "crd_U0FBPmz5t2zjDjKaOGABlo6A",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "refunded": false,
    "refunds": [],
    "installments_count": 0,
    "installments": []
}

Property Description
token string Unique identifier (ID) for the payment object. Always starts with the prefix pmt_.
date_created string The creation date of payment in ISO 8601 format.
description string A description of the payment.
amount integer The payment amount in the smallest currency unit e.g in cents.
currency string Currency represented as three-letter ISO 4217 code.
status string Indicates the payment status.
Captured
Failed
Refunded
Partially Refunded
Disputed
Pending
Pre Authorized
Canceled
Expired
refund_amount integer Amount refunded in cents which is less or equal than the payment amount.
fee_amount integer Service fee amount for the payment.
payee_email string The email address to which a payment receipt will be sent.
payee_phone string Customer’s phone number.
merchant_ref string A unique ID set by the merchant.
card object An object containing card details with which the payment was completed.
refunded boolean Indicates whether payment has been fully refunded. If the payment is only partially refunded, this attribute will still be false.
refunds list A list of refunds that have been applied to the payment.
installments_count integer An integer which indicates the installment count supplied to the payment.
installments list A list of installment objects that have been applied to the payment.

Create a payment

Definition

POST https://api.everypay.gr/payments

Example request with card data

$ curl https://api.everypay.gr/payments \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d card_number=4111111111111111 \
  -d expiration_year=2022 \
  -d expiration_month=05 \
  -d holder_name="John Doe" \
  -d cvv=123 \
  -d amount=1000 \
  -d description="Order #GGA-435167" 

Example request with card token

$ curl https://api.everypay.gr/payments \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d token=ctn_KJ53Qx3ZGaNLttUNxyB5JQO3 \
  -d amount=1000 \
  -d description="Order #GGA-435167"

Example request with customer token

$ curl https://api.everypay.gr/payments \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d token=cus_RxE6DEcITxOYyynErDK6VoBa \
  -d amount=1000 \
  -d description="Order #GGA-435167"

Example Response

200 OK
{
    "token": "pmt_lkPJrywRlDAp5oKrqOeRHEt0",
    "date_created": "2019-02-14T19:47:03+0200",
    "description": "Order #GGA-435167",
    "currency": "EUR",
    "status": "Captured",
    "amount": 1000,
    "refund_amount": 0,
    "fee_amount": 48,
    "payee_email": null,
    "payee_phone": null,
    "merchant_ref": null,
    "card": {
        "token": "crd_U0FBPmz5t2zjDjKaOGABlo6A",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "refunded": false,
    "refunds": [],
    "installments_count": 0,
    "installments": []
}

You can create a payment by charging a payment card using one of the following, as shown in the examples:

Body Arguments  
amount required A positive integer in the smallest currency unit e.g in cents (e.g 10,99 EUR shall be converted to 1099).
card arguments optional All required fields of the Card Arguments.
token optional It can be either a Card Token ID or a Customer ID.
card optional In case a payment is made with a Customer ID you can define which card of the customer will be charged by providing a valid Card ID. If this atrribute is skipped then the customer’s default card will be used.
description optional A description of the payment.
capture optional
1
Whether to immediately capture the payment.
1 payment will be captured.
0 only a pre-authorize request will be send in order to hold on the amount. In that case you have to capture the payment in a second step.
payee_email optional Provide the email address to which a payment receipt will be sent. This will override a customer’s email address in case payment is made with a customer token.
payee_phone optional Provide the customer’s phone.
installments optional A positive integer indicating the number of installments which the payer has applied to. Max. installment count is 36 and depends on merchant’s configuration. If card or merchant account doesn’t support installments an error will be thrown.
max_installments optional A positive integer indicating the maximum count of allowed installments. This value is taken into account only if in the token parameter a Token ID is passed. This will ensure that the max. installment value of the token matches the provided value. If a mismatch is encountered then an error will be thrown.
merchant_ref optional A unique ID set by the merchant. The merchant reference ID remains the same throughout the lifetime of the payment. Maximum chars 120. If a payment with the same merchant reference ID is again submitted then an error will be thrown.
create_customer optional
0
1 after a successfull payment a customer object is created and the payment card is assigned to it as default card.
0 no customer object is created.
customer optional By providing a Customer ID along with the payment details, the payment and the Card is assigned to the specified customer. This is useful if in case a customer is paying with a new card and you want to avoid multiple API calls.
default_card optional
0
Shall be used in conjuction with the customer parameter.
1 If the payment succeeds the used card will be assigned to the above customer object and marked as default.
0 the card will be added to the list of cards of the customer object.

Retrieve a payment

Definition

GET https://api.everypay.gr/payments/{paymentId}

Example Request

$ curl https://api.everypay.gr/payments/pmt_lkPJrywRlDAp5oKrqOeRHEt0 \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "token": "pmt_lkPJrywRlDAp5oKrqOeRHEt0",
    "date_created": "2019-02-14T19:47:03+0200",
    "description": "Order #GGA-435167",
    "currency": "EUR",
    "status": "Captured",
    "amount": 1000,
    "refund_amount": 0,
    "fee_amount": 48,
    "payee_email": null,
    "payee_phone": null,
    "merchant_ref": null,
    "card": {
        "token": "crd_U0FBPmz5t2zjDjKaOGABlo6A",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "refunded": false,
    "refunds": [],
    "installments_count": 0,
    "installments": []
}

Retrieves the details of a payment. Provide the unique payment ID that was returned from the creation call.

Path Arguments  
paymentId required The unique Payment ID.

Capture a payment

Definition

PUT https://api.everypay.gr/payments/{paymentId}/capture

Example Request

$ curl https://api.everypay.gr/payments/pmt_lkPJrywRlDAp5oKrqOeRHEt0/capture \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:
  -X PUT

Example Response

200 OK
{
    "token": "pmt_lkPJrywRlDAp5oKrqOeRHEt0",
    "date_created": "2019-02-14T19:47:03+0200",
    "description": "Order #GGA-435167",
    "currency": "EUR",
    "status": "Captured",
    "amount": 1000,
    "refund_amount": 0,
    "fee_amount": 48,
    "payee_email": null,
    "payee_phone": null,
    "merchant_ref": null,
    "card": {
        "token": "crd_U0FBPmz5t2zjDjKaOGABlo6A",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "refunded": false,
    "refunds": [],
    "installments_count": 0,
    "installments": []
}

Capture a previous per-authorized payment that was created with captured=0 argument. This is the second part of the two step payment flow.

Path Arguments  
paymentId required The unique Payment ID.

List all payments

Definition

GET https://api.everypay.gr/payments

Example Request

$ curl https://api.everypay.gr/payments?count=5&offset=0 \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "total_count": 381,
    "items": [
        {
            "token": "pmt_lkPJrywRlDAp5oKrqOeRHEt0",
            "date_created": "2019-02-14T19:47:03+0200",
            "description": "Order #GGA-435167",
            "currency": "EUR",
            "status": "Captured",
            "amount": 1000,
            "refund_amount": 0,
            "fee_amount": 48,
            "payee_email": null,
            "payee_phone": null,
            "merchant_ref": null,
            "card": {
                "token": "crd_U0FBPmz5t2zjDjKaOGABlo6A",
                "expiration_month": "05",
                "expiration_year": "2019",
                "bin": "411111",
                "last_four": "1111",
                "type": "Visa",
                "holder_name": "John Doe",
                "supports_installments": false,
                "status": "valid",
                "friendly_name": "Visa •••• 1111 (05/2019)",
                "tds": {
                    "enrolled": null,
                    "eci_flag": null,
                    "auth_code": null,
                    "auth_desc": null
                }
            },
            "refunded": false,
            "refunds": [],
            "installments_count": 0,
            "installments": []
        },
        {...},
        {...},
        {...},
        {...}
    ]
}

Returns a list of payments. You can use the below parameters to limit the results and paginate through the list.

Query Arguments  
count optional
10
20
The number of records to return back in response. Limit can range between 1 and 20.
offset optional
0
The number of records to skip before adding results to the response.
date_from optional Provide a date from in YYYY-MM-DD format.
date_to optional Provide a date to in YYYY-MM-DD format.
merchant_ref optional Provide the unique merchant reference ID used in the payment creation call.

Refunds

Refunds allow you to refund a payment. The refunded amount will be credited to the payment card that was originally charged.

The refund object

The refund object

{
    "token": "ref_ew6fZqrUbWrfCQuPgcSjeYD7",
    "date_created": "2019-02-15T18:54:38+0300",
    "status": "Captured",
    "amount": 10000,
    "fee_amount": 120,
    "description": "Refund for Order #123",
    "payment": "pmt_UKQs1FCubxhtOdVIGfZPt1ER"
}

Property Description
token string Unique identifier (ID) for the refund object. Always starts with the prefix ref_.
date_created string The creation date of refund in ISO 8601 format.
status string Indicates the refund status.
Captured
Failed
amount integer The refund amount in the smallest currency unit e.g in cents.
fee_amount integer The service fee amount that is refunded as well, and is calculated proportionally to the refund amount.
description string The refund reason.
payment string A Payment ID of the payment that was refunded.

Create a refund

Definition

POST https://api.everypay.gr/refunds

Example request

$ curl https://api.everypay.gr/refunds \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d payment=pmt_UKQs1FCubxhtOdVIGfZPt1ER \
  -d amount=10000 \
  -d description="Refund for Order #123"

Example Response

200 OK
{
    "token": "ref_ew6fZqrUbWrfCQuPgcSjeYD7",
    "date_created": "2019-02-15T18:54:38+0300",
    "status": "Captured",
    "amount": 10000,
    "fee_amount": 120,
    "description": "Refund for Order #123",
    "payment": "pmt_UKQs1FCubxhtOdVIGfZPt1ER"
}

Refund an existing payment, which will result in funds being returned to the previously charged payment card. It is possible to only refund part of captured payment. This partial refund can be repeated for as long as the payment is not fully refunded.

Body Arguments  
payment required The Payment ID of the payment to refund.
amount optional The amount (in cents) to refund. This must be less or equal to current amount of payment that is being refunded. If no amount is provided then the remaining amount of payment will be used.
description optional Useful to describe the refund reason.

Retrieve a refund

Definition

GET https://api.everypay.gr/refunds/{refundId}

Example Request

$ curl https://api.everypay.gr/refunds/ref_ew6fZqrUbWrfCQuPgcSjeYD7 \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "token": "ref_ew6fZqrUbWrfCQuPgcSjeYD7",
    "date_created": "2019-02-15T18:54:38+0300",
    "status": "Captured",
    "amount": 10000,
    "fee_amount": 120,
    "description": "Refund for Order #123",
    "payment": "pmt_UKQs1FCubxhtOdVIGfZPt1ER"
}

Retrieves the details of a refund. Provide the unique refund ID that was returned from the creation call.

Path Arguments  
refundId required The unique Refund ID.

List all refunds

Definition

GET https://api.everypay.gr/refunds

Example Request

$ curl https://api.everypay.gr/refunds \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "total_count": 122,
    "items": [
        {
            "token": "ref_ew6fZqrUbWrfCQuPgcSjeYD7",
            "date_created": "2019-02-15T18:54:38+0300",
            "status": "Captured",
            "amount": 10000,
            "fee_amount": 120,
            "description": "Refund for Order #123",
            "payment": "pmt_UKQs1FCubxhtOdVIGfZPt1ER"
        },
        {...},
        {...},
        {...},
        {...}
    ]
}

Returns a list of refunds. You can use the below parameters to limit the results and paginate through the list.

Query Arguments  
count optional
10
20
The number of records to return back in response. Limit can range between 1 and 20.
offset optional
0
The number of records to skip before adding results to the response.
date_from optional Provide a date from in YYYY-MM-DD format.
date_to optional Provide a date to in YYYY-MM-DD format.
payment optional Provide the Payment ID to fetch refunds only for the specified payment.

Tokens

Tokens are used in case you do not want to process or store sensitive card data, such as card number or CVV, on your servers. They can be easily obtained with the use of the EveryPay Button, but you can also create tokens, via our API, in other environments (for example in mobile apps).

Tokens can be created by using either your Public Key or your Secret Key. You can safely embed your Public Key in JavaScript frontend apps or mobile apps (such as iOS or Android), in order to avoid processing of sensitive card data.

The token object

The token object

{
  "token": "ctn_KJ53Qx3ZGaNLttUNxyB5JQO3",
  "is_used": false,
  "has_expired": false,
  "amount": 1000,
  "date_created": "2019-02-14T16:51:46+0200",
  "card": {
    "token": "crd_N9YNHC2TUskLo2hWNi3BkK8Z",
    "expiration_month": "05",
    "expiration_year": "2022",
    "bin": "411111",
    "last_four": "1111",
    "type": "Visa",
    "holder_name": "John Doe",
    "supports_installments": false,
    "max_installments": 0,
    "status": "valid",
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
      "enrolled": null,
      "eci_flag": null,
      "auth_code": null,
      "auth_desc": null
    }
  }
}

Property Description
token string Unique identifier (ID) for the token object. Always starts with the prefix ctn_.
is_used boolean Determines whether this token has already been used.
has_expired boolean Determines whether the token has expired. If token has expired it can not be used in any transaction.
amount integer A positive integer in the smallest currency unit e.g in cents (e.g 10,99 EUR shall be converted to 1099). You can use this to bind the specific token with the provided amount.
date_created string The creation date of token in ISO 8601 format.
card object A card object containing the card details.

Create a token

Definition

POST https://api.everypay.gr/tokens

Example Request

$ curl https://api.everypay.gr/tokens \
  -u pk_atFzbY3VB94gFFJ3FxArEWM8DpnuA1y8: \
  -d card_number=411111111111111 \
  -d expiration_year=2022 \
  -d expiration_month=05 \
  -d cvv=334 \
  -d holder_name="John Doe" \
  -d amount=1000

Example Response

200 OK
{
  "token": "ctn_KJ53Qx3ZGaNLttUNxyB5JQO3",
  "is_used": false,
  "has_expired": false,
  "amount": 1000,
  "date_created": "2019-02-14T16:51:46+0200",
  "card": {
    "token": "crd_N9YNHC2TUskLo2hWNi3BkK8Z",
    "expiration_month": "05",
    "expiration_year": "2022",
    "bin": "411111",
    "last_four": "1111",
    "type": "Visa",
    "holder_name": "John Doe",
    "supports_installments": false,
    "max_installments": 0,
    "status": "valid",
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
      "enrolled": null,
      "eci_flag": null,
      "auth_code": null,
      "auth_desc": null
    }
  }
}

Creates a single-use token that represents a payment card’s details.

Body Arguments  
card arguments required All required fields of the Card Arguments.
amount optional A positive integer in the smallest currency unit e.g in cents (e.g 10,99 EUR shall be converted to 1099).

Retrieve a token

Definition

GET https://api.everypay.gr/tokens/{tokenId}

Example Request

$ curl https://api.everypay.gr/tokens/ctn_KJ53Qx3ZGaNLttUNxyB5JQO3 \
  -u pk_atFzbY3VB94gFFJ3FxArEWM8DpnuA1y8:

Example Response

200 OK
{
  "token": "ctn_KJ53Qx3ZGaNLttUNxyB5JQO3",
  "is_used": false,
  "has_expired": false,
  "amount": 1000,
  "date_created": "2019-02-14T16:51:46+0200",
  "card": {
    "token": "crd_N9YNHC2TUskLo2hWNi3BkK8Z",
    "expiration_month": "05",
    "expiration_year": "2022",
    "bin": "411111",
    "last_four": "1111",
    "type": "Visa",
    "holder_name": "John Doe",
    "supports_installments": false,
    "max_installments": 0,
    "status": "valid",
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
      "enrolled": null,
      "eci_flag": null,
      "auth_code": null,
      "auth_desc": null
    }
  }
}

Retrieve an existing token object.

Path Arguments  
tokenId required The unique Token ID.

Customers

Customers allows you to store multiple tokenized cards for later use on a single object. Customers are useful for tracking payments and perform recurring payment that are associated with the same entity.

The customer object

The customer object

{
    "token": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "description": "Club Member",
    "email": "cofounder@themail.com",
    "date_created": "2019-02-14T17:50:09+0200",
    "full_name": "John Doe",
    "is_active": true,
    "date_modified": "2019-02-14T17:50:09+0200",
    "card": {
        "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "max_installments": 0,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "cards": {
        "count": 1,
        "data": [
            {
                "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
                "expiration_month": "05",
                "expiration_year": "2022",
                "bin": "411111",
                "last_four": "1111",
                "type": "Visa",
                "holder_name": "John Doe",
                "supports_installments": false,
                "max_installments": 0,
                "status": "valid",
                "friendly_name": "Visa •••• 1111 (05/2022)",
                "tds": {
                    "enrolled": null,
                    "eci_flag": null,
                    "auth_code": null,
                    "auth_desc": null
                }
            }
        ]
    }
}

Property Description
token string Unique identifier (ID) for the customer object. Always starts with the prefix cus_.
description string A description of your customer object.
full_name string Customer’s full name.
email string Customer’s email address. In case a payment is made with a customer object this address will be used to send a payment receipt.
date_created string The creation date of customer in ISO 8601 format.
is_active boolean Indicates if customer is active. Inactive customer cannot longer perform any payments.
date_modified string The latest modification date of customer in ISO 8601 format.
card object An object containing card details which indicates the customer’s default card as well.
cards list A list of cards associated with this customer.

Create a customer

Definition

POST https://api.everypay.gr/customers

Example request with card data

$ curl https://api.everypay.gr/customers \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d card_number=4111111111111111 \
  -d expiration_year=2022 \
  -d expiration_month=05 \
  -d holder_name="John Doe" \
  -d email=customer@themail.com \
  -d description="Club Member" \
  -d full_name="John Doe"

Example request with card token

$ curl https://api.everypay.gr/customers \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d token=ctn_KJ53Qx3ZGaNLttUNxyB5JQO3 \
  -d email=customer@themail.com \
  -d description="Club Member" \
  -d full_name="John Doe"

Example Response

200 OK
{
    "token": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "description": "Club Member",
    "email": "cofounder@themail.com",
    "date_created": "2019-02-14T17:50:09+0200",
    "full_name": "John Doe",
    "is_active": true,
    "date_modified": "2019-02-14T17:50:09+0200",
    "card": {
        "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "max_installments": 0,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "cards": {
        "count": 1,
        "data": [
            {
                "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
                "expiration_month": "05",
                "expiration_year": "2022",
                "bin": "411111",
                "last_four": "1111",
                "type": "Visa",
                "holder_name": "John Doe",
                "supports_installments": false,
                "max_installments": 0,
                "status": "valid",
                "friendly_name": "Visa •••• 1111 (05/2022)",
                "tds": {
                    "enrolled": null,
                    "eci_flag": null,
                    "auth_code": null,
                    "auth_desc": null
                }
            }
        ]
    }
}

You can create a customer object by providing one of the following, as shown in the examples:

Body Arguments  
card arguments optional All required fields of the Card Arguments, except card’s CVV.
token optional An unused and non expired Card Token ID.
description optional A description of your customer object.
full_name optional Customer’s full name.
email optional Customer’s email address. This address is used in order to send the payment receipt.

Retrieve a customer

Definition

GET https://api.everypay.gr/customers/{customerId}

Example Request

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "token": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "description": "Club Member",
    "email": "cofounder@themail.com",
    "date_created": "2019-02-14T17:50:09+0200",
    "full_name": "John Doe",
    "is_active": true,
    "date_modified": "2019-02-14T17:50:09+0200",
    "card": {
        "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "max_installments": 0,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
            "enrolled": null,
            "eci_flag": null,
            "auth_code": null,
            "auth_desc": null
        }
    },
    "cards": {
        "count": 1,
        "data": [
            {
                "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
                "expiration_month": "05",
                "expiration_year": "2022",
                "bin": "411111",
                "last_four": "1111",
                "type": "Visa",
                "holder_name": "John Doe",
                "supports_installments": false,
                "max_installments": 0,
                "status": "valid",
                "friendly_name": "Visa •••• 1111 (05/2022)",
                "tds": {
                    "enrolled": null,
                    "eci_flag": null,
                    "auth_code": null,
                    "auth_desc": null
                }
            }
        ]
    }
}

Retrieve an existing customer object.

Path Arguments  
customerId required The unique Customer ID.

Update a customer

Definition

PUT https://api.everypay.gr/customers/{customerId}

Example update request of customer’s details

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d email="newmail@example.com" \
  -d full_name="Steve Doe" \
  -d description="Silver Member" \
  -X PUT

Example update request of customer’s default card

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d card=crd_xDQhOiVCyKFcUphQMEdUPuXQ
  -d default_card=1
  -X PUT

Example Response

200 OK
{
  "token": "cus_RxE6DEcITxOYyynErDK6VoBa",
  "description": "Silver Member",
  "email": "newmail@example.com",
  "date_created": "2019-02-14T17:50:09+0200",
  "full_name": "Steve Doe",
  "is_active": true,
  "date_modified": "2019-02-14T17:50:09+0200",
  "card": {
    "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
    "expiration_month": "05",
    "expiration_year": "2022",
    "bin": "411111",
    "last_four": "1111",
    "type": "Visa",
    "holder_name": "John Doe",
    "supports_installments": false,
    "max_installments": 0,
    "status": "valid",
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
      "enrolled": null,
      "eci_flag": null,
      "auth_code": null,
      "auth_desc": null
    }
  },
  "cards": {
    "count": 1,
    "data": [
      {
        "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
        "expiration_month": "05",
        "expiration_year": "2022",
        "bin": "411111",
        "last_four": "1111",
        "type": "Visa",
        "holder_name": "John Doe",
        "supports_installments": false,
        "max_installments": 0,
        "status": "valid",
        "friendly_name": "Visa •••• 1111 (05/2022)",
        "tds": {
          "enrolled": null,
          "eci_flag": null,
          "auth_code": null,
          "auth_desc": null
        }
      }
    ]
  }
}

Update an existing customer’s information. Any not provided parameter will be left unchanged.

Path Arguments  
customerId required The Customer ID.
Body Arguments  
description optional A description of your customer object.
full_name optional Customer’s full name.
email optional Customer’s email address. This address is used in order to send the payment receipt.
card optional The Card ID.
default_card optional
0
Whether to set provided card as default.
1 mark card as default.
0 no change is performed.

Delete a customer

Definition

DELETE https://api.everypay.gr/customers/{customerId}

Example Request

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -X DELETE

Example Response

200 OK
{
    "token": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "description": "Club Member",
    "email": "customer@themail.com",
    "date_created": "2019-02-14T17:50:09+0200",
    "full_name": "John Doe",
    "is_active": false,
    "date_modified": "2019-02-14T17:50:09+0200"
}

Deletes an existing customer object.

Path Arguments  
customerId required The unique Customer ID.

List all customers

Definition

GET https://api.everypay.gr/customers

Example Request

$ curl https://api.everypay.gr/customers?count=5&offset=0 \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "total_count": 122,
    "items": [
        {
            "token": "cus_RxE6DEcITxOYyynErDK6VoBa",
            "description": "Club Member",
            "email": "customer@themail.com",
            "date_created": "2019-02-14T17:50:09+0200",
            "full_name": "John Doe",
            "is_active": true,
            "date_modified": "2019-02-14T17:50:09+0200",
            "card": {
                "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
                "expiration_month": "05",
                "expiration_year": "2022",
                "bin": "411111",
                "last_four": "1111",
                "type": "Visa",
                "holder_name": "John Doe",
                "supports_installments": false,
                "status": "valid",
                "friendly_name": "Visa •••• 1111 (05/2022)",
                "tds": {
                    "enrolled": null,
                    "eci_flag": null,
                    "auth_code": null,
                    "auth_desc": null
                }
            },
            "cards": {
                "count": 1,
                "data": [
                    {
                        "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
                        "expiration_month": "05",
                        "expiration_year": "2022",
                        "bin": "411111",
                        "last_four": "1111",
                        "type": "Visa",
                        "holder_name": "John Doe",
                        "supports_installments": false,
                        "status": "valid",
                        "friendly_name": "Visa •••• 1111 (05/2022)",
                        "tds": {
                            "enrolled": null,
                            "eci_flag": null,
                            "auth_code": null,
                            "auth_desc": null
                        }
                    }
                ]
            }
        },
        {...},
        {...},
        {...},
        {...}
    ]
}

Returns a list of customers. You can use the below parameters to limit the results and paginate through the list.

Query Arguments  
count optional
10
20
The number of records to return back in response. Limit can range between 1 and 20.
offset optional
0
The number of records to skip before adding results to the response.
date_from optional Provide a date from in YYYY-MM-DD format.
date_to optional Provide a date to in YYYY-MM-DD format.

Cards

Cards are representing a payment card (credit, debit, prepaid) and are used to save card data for later use.

Cards can also be used to represent card data in other operations (for example to specify card data when creating a new Payment or a Token).

The card object

The card object

{
    "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
    "type": "Visa",
    "bin": "411111",
    "last_four": "1111",
    "expiration_month": "05",
    "expiration_year": "2022",
    "holder_name": "John Doe",
    "status": "valid",
    "customer": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "supports_installments": false,
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
        "enrolled": null,
        "eci_flag": null,
        "auth_code": null,
        "auth_desc": null
    }
}

Property Description
token string Unique identifier (ID) for the card object. Always starts with the prefix crd_.
type string The card type (Visa, MasterCard, etc.).
bin string The first six digits of the payment card number.
last_four string The last four digits of the card number.
expiration_month string A two-digit number representing the expiration month of a card (e.g., 08 for August).
expiration_year string A four-digit number representing the expiration year of a card (e.g. 2022).
holder_name string The cardholder’s name.
status string Indicates the card status.
valid
expired
customer string A Customer ID that is owner of this card.
supports_installments boolean Indicates if card supports installments.
friendly_name string A friendly representation of card’s data.
tds.enrolled string tds.enrolled
tds.eci_flag string tds.eci_flag
tds.auth_code string tds.auth_code
tds.auth_desc string tds.auth_desc

Create a card

Definition

POST https://api.everypay.gr/customers/{customerId}/cards

Example request with card data

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa/cards \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d card_number=4111111111111111 \
  -d expiration_year=2022 \
  -d expiration_month=05 \
  -d holder_name="John Doe" \
  -d default_card=1

Example request with card token

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa/cards \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
  -d token=ctn_KJ53Qx3ZGaNLttUNxyB5JQO3

Example Response

200 OK
{
    "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
    "type": "Visa",
    "bin": "411111",
    "last_four": "1111",
    "expiration_month": "05",
    "expiration_year": "2022",
    "holder_name": "John Doe",
    "status": "valid",
    "customer": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "supports_installments": false,
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
        "enrolled": null,
        "eci_flag": null,
        "auth_code": null,
        "auth_desc": null
    }
}

You can add a new card to an existing customer by providing, the same arguments as in a Create Customer call. By providing the argument default_card=1 you can set the newly created card as the customer’s default card.

Path Arguments  
customerId required The unique Customer ID.
Body Arguments  
card arguments optional All required fields of the Card Arguments, except card’s CVV.
token optional An unused and non expired Card Token ID.
default_card optional
0
Whether to set provided card as default.
1 mark card as default.
0 no change is performed.

Retrieve a card

Definition

GET https://api.everypay.gr/customers/{customerId}/cards/{cardId}

Example Request

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa/cards/crd_xDQhOiVCyKFcUphQMEdUPuXQ \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
    "type": "Visa",
    "bin": "411111",
    "last_four": "1111",
    "expiration_month": "05",
    "expiration_year": "2022",
    "holder_name": "John Doe",
    "status": "valid",
    "customer": "cus_RxE6DEcITxOYyynErDK6VoBa",
    "supports_installments": false,
    "friendly_name": "Visa •••• 1111 (05/2022)",
    "tds": {
        "enrolled": null,
        "eci_flag": null,
        "auth_code": null,
        "auth_desc": null
    }
}

Retrieve details of an existing card object that belongs to a customer.

Path Arguments  
customerId required The unique Customer ID.
cardId required The unique Card ID.

Delete a card

Definition

DELETE https://api.everypay.gr/customers/{customerId}/cards/{cardId}

Example Request

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa/cards/crd_FIAoNSiXlwpnSJrfojsrPdH4 \
 -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R: \
 -X DELETE

Example Response

200 OK
{
  "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
  "is_deleted": true
}

You can delete a customer card by using this resource. If you delete a card that is the default card then the most recently added card will be used as new default card.

Path Arguments  
customerId required The unique Customer ID.
cardId required The unique Card ID.

List all cards

Definition

GET https://api.everypay.gr/customers/{customerID}/cards

Example Request

$ curl https://api.everypay.gr/customers/cus_RxE6DEcITxOYyynErDK6VoBa/cards \
  -u sk_PqSohnrYrRI1GUKOZvDkK5VVWAhnlU3R:

Example Response

200 OK
{
    "total_count": 3,
    "items": [
        {
            "token": "crd_xDQhOiVCyKFcUphQMEdUPuXQ",
            "type": "Visa",
            "bin": "411111",
            "last_four": "1111",
            "expiration_month": "05",
            "expiration_year": "2022",
            "holder_name": "John Doe",
            "status": "valid",
            "customer": "cus_RxE6DEcITxOYyynErDK6VoBa",
            "supports_installments": false,
            "friendly_name": "Visa •••• 1111 (05/2022)",
            "tds": {
                "enrolled": null,
                "eci_flag": null,
                "auth_code": null,
                "auth_desc": null
            }
        },
        {...},
        {...}
    ]
}

Returns a list of the cards belonging to a customer. You can use the below parameters to limit the results and paginate through the list.

Query Arguments  
count optional
10
20
The number of records to return back in response. Limit can range between 1 and 20.
offset optional
0
The number of records to skip before adding results to the response.
date_from optional Provide a date from in YYYY-MM-DD format.
date_to optional Provide a date to in YYYY-MM-DD format.
Data Structures

Card arguments

Arguments  
card_number required Card number without any separators.
expiration_year required Card expiration year (4 digits).
expiration_month required Card expiration month (2 digits).
holder_name required Cardholder’s name.
cvv required The 3 or 4 digits security code of the card.