Send SMS

0. Pre-requisites

Before using API, you should configure a business in your payever account. Configuration includes the following steps:

  1. Create a business.
  2. Go to a section “Point of Sale” and create a PoS terminal.
  3. Connect your Twilio account, buy and link a phone number to you PoS terminal.
  4. In your payever account, set the PoS terminal to use as default.
1. Initializing payment

Headers Content-Type and Accept should be set to application/json and data should be sent as json payload.

Payment initialization request looks like this:

POST http://mein.payever.de/pos/api/v1/external/b197bf22-6309-11e7-a2a8-5254008319f0
Content-Type: application/json
Accept: application/json
{
  "amount": 25.14,
  "phone_number": 79528224321
}

It creates payment record in the payever database and sends payment link to customer. Response contains the following data:

{
  "merchant_id": "b197bf22-6309-11e7-a2a8-5254008319f0", // merchant/business id 
  "timestamp": "2018-01-24T12:30:40+00:00" // payment timestamp
}

Pay and get confirmation code

2. Payment

After receiving sms with payment link, customer finishes payment on his device. After successful payment he receives code to verify payment.

3. Payment confirmation

This request is used to verify payment status.

Request example:

GET http://mein.payever.de/pos/api/v1/external/code/check?merchant_id=b197bf22-6309-11e7-a2a8-5254008319f0&code=630560×tamp=2018-01-24T11:57:21%2B00:00&token=NzZhYTZiMWJmMmNmZWFhODlmNDBlMTZjNjUzOTljOTI2ZDNmZGYzNmE4MjI2NTcxYzQ3MDQ2NjQ3MjYzMmZhOQ&amount=256.34

GET Request parameters explained:

ParameterDescriptionExample
merchant_idmerchant id from your payever accountb197bf22-6309-11e7-a2a8-5254008319f0
codePayment confirmation code630560
timestampPayment timestamp2018-01-24T11:57:21 00:00
tokenSecurity token to access payment dataNzZhYTZiMWJmMmNmZWFhODlmNDBlMTZjNjUzOTljOTI2ZDNmZGYzNmE4MjI2NTcxYzQ3MDQ2NjQ3MjYzMmZhOQ
amountPayment amount for verification256.34

Response example:

{
  "amount": 256.34
  "status": "santander_installment_se"
  "payment_method": "STATUS_PAID"
}

In response, field payment_status can have one of the following values: null - payment is not started yet

STATUS_NEW - payment started
STATUS_IN_PROCESS - payment is in process
STATUS_ACCEPTED - payment is accepted
STATUS_PAID - payment is finished
STATUS_DECLINED - payment is declined
STATUS_REFUNDED - payment is refunded
STATUS_FAILED - payment is failed
STATUS_CANCELLED - payment is cancelled

Example

External collection.postman_collection.json:

{
    "info": {
        "name": "External Payment",
        "_postman_id": "c8331bf4-66ee-3b3f-1f3f-53e404632f45",
        "description": "",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "Create a Code",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{nt"amount": 25.14,nt"phone_number": 79528224321n}"
                },
                "url": {
                    "raw": "https://stage.payever.de/pos/api/v1/external/b197bf22-6309-11e7-a2a8-5254008319f0",
                    "protocol": "https",
                    "host": [
                        "stage",
                        "payever",
                        "de"
                    ],
                    "path": [
                        "pos",
                        "api",
                        "v1",
                        "external",
                        "b197bf22-6309-11e7-a2a8-5254008319f0"
                    ]
                },
                "description": null
            },
            "response": []
        },
        {
            "name": "Validate a code",
            "request": {
                "method": "GET",
                "header": [],
                "body": {},
                "url": {
                    "raw": "http://stage.payever.de/pos/api/v1/external/code/check?merchant_id=b197bf22-6309-11e7-a2a8-5254008319f0&code=440561×tamp=2018-01-24T11:57:21%2B00:00&token=NzZhYTZiMWJmMmNmZWFhODlmNDBlMTZjNjUzOTljOTI2ZDNmZGYzNmE4MjI2NTcxYzQ3MDQ2NjQ3MjYzMmZhOQ&amount=256.34",
                    "protocol": "http",
                    "host": [
                        "stage",
                        "payever",
                        "de"
                    ],
                    "path": [
                        "pos",
                        "api",
                        "v1",
                        "external",
                        "code",
                        "check"
                    ],
                    "query": [
                        {
                            "key": "merchant_id",
                            "value": "b197bf22-6309-11e7-a2a8-5254008319f0",
                            "equals": true
                        },
                        {
                            "key": "code",
                            "value": "440561",
                            "equals": true
                        },
                        {
                            "key": "timestamp",
                            "value": "2018-01-24T11:57:21%2B00:00",
                            "equals": true
                        },
                        {
                            "key": "token",
                            "value": "NzZhYTZiMWJmMmNmZWFhODlmNDBlMTZjNjUzOTljOTI2ZDNmZGYzNmE4MjI2NTcxYzQ3MDQ2NjQ3MjYzMmZhOQ",
                            "equals": true
                        },
                        {
                            "key": "amount",
                            "value": "256.34",
                            "equals": true
                        }
                    ]
                },
                "description": ""
            },
            "response": []
        }
    ]
}