P2P API
Info
PCI DSS certificate is required to use this API and process non-encrypted card data.
Check the capability of the P2P transfer
The requests described below are used:
- to check the capability of the P2P transfer between the source card and the receiver card;
- to get information on the commission of the P2P transfer and additional card data required to make a transfer.
Send one of the POST requests depending on your integration.
Request authorized by the secret key
Send a POST request with Basic authorization by Shop ID and Shop Secret key to https://gateway.pay-cross.com/p2p-restrictions. Use the parameters described here.
Request authorized by the public key in synchronous mode
In synchronous mode, you receive a response to your request with all parameters after the system processes your request.
Send a POST request with the Bearer authorization by the public key and the X-Api-Version: 2 header to https://panel.pay-cross.com/ctp/api/verify-p2p. Use the parameters described here.
Request authorized by the public key in asynchronous mode
In asynchronous mode, you send a request with the same parameters as for a synchronous request, but you receive a response with the new task status and the job_id that the system assigned to your request. Further on, you should check the relevant task status.
Send an HTTP POST request with the Bearer authorization by the Public key and the X-Api-Version: 2 header to https://panel.pay-cross.com/ctp/api/async/verify-p2p. Use the parameters described here.
Response example with the task status new and job_id
{
"status": "new",
"job_id": "62c5b51a1d69bde6e5afaa70"
}
To get a task status, send a GET request with job_id to https://panel.pay-cross.com/ctp/api/async/jobs/{job_id}.
Response example for the task with new status
{
"status": "new",
"job_id": "62c5b51a1d69bde6e5afaa70"
}
Response example for the task with failed status
{
"job_id": "62c5b51a1d69bde6e5afaa70",
"status": "failed",
"response": {
"status": "error",
"errors": [
"error"
],
"message": "Request processing error. Please try again later",
"finished": false
}
}
Response example for the task with done status
{
"status": "done",
"job_id": "62c5b51a1d69bde6e5afaa70",
"response": {
//Standard response parameters
}
}
Request parameters
|
|||||||||||||||||||||||||||||||||||||||||||||||||
Request example
{
"request": {
"amount": 100,
"currency": "USD",
"credit_card": {
"number": "4012001037141112"
},
"recipient_card": {
"number": "4200000000000000"
},
"test": true
}
}
Response parameters
If the transfer is possible, the response contains the following parameters:
|
|||||||||||||||||||
Example of the response
{
"status": "successful",
"message": "p2p is allowed",
"commission": {
"minimum": 0.7,
"percent": 1.5,
"bank_fee": 7.35,
"currency": "USD"
}
}
If the transfer is not possible, the response contains the following parameters:
|
|||||||||||||
Example of the response
{
"status": "failed",
"message": "Missed credit card fields: holder.Missed recipient card fields: holder.",
"required_fields": {
"credit_card": [
"holder"
],
"recipient_card": [
"holder"
]
}
}
In case of an error the response contains the following parameters:
| |||||||||||
Example of the response: http 422
{
"error_code": "invalid_params",
"message": "Unprocessable entity",
"errors": {
"amount": [
"must be an integer"
],
"currency": [
"is unknown ISO 4217 Alpha-3 code"
],
"credit_card": {
"number": [
"is not a card number"
]
},
"recipient_card": {
"number": [
"is not a card number"
]
}
}
}
Example of the response: http 403
{
"error_code": "absent_allowed_gateways",
"message": "No available gateways. Allowed gateways are missing. Contact the payment service provider for details."
}
Make the P2P transfer
To make a P2P transfer via the PayCross API, send one of the POST requests described below depending on your integration.
Requests authorized by the secret key
Send a POST request with Basic authorization by Shop ID and Shop Secret key to https://gateway.pay-cross.com/transactions/p2ps. Use the parameters described here.
Requests authorized by the public key in synchronous mode
In synchronous mode, you send a request and receive a response with the parameters only after the system processes the request.
Send a POST request with the Bearer authorization by the public key and the X-Api-Version: 2 header to https://panel.pay-cross.com/ctp/api/p2p. Use the parameters described here.
Requests authorized by the public key in asynchronous mode
In asynchronous mode, you send a request with the same parameters as for a synchronous request, but you receive a response with the new task status and the job_id that the system assigned to your request. Further on, you should check the relevant task status.
Send a POST request with the Bearer authorization by the public key and the X-Api-Version: 2 header to https://panel.pay-cross.com/ctp/api/async/p2p. Use the parameters described here.
Example of the response with task status new and job_id
{
"status": "new",
"job_id": "62c5b51a1d69bde6e5afaa70"
}
To get the task status, send a GET request specifying the received job_id to https://panel.pay-cross.com/ctp/api/async/jobs/{job_id}.
The response schemes for the new, failed, done task statuses are the same as described for requests checking the capability of the P2P transfer.
Request parameters
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request example
{
"request": {
"test": false,
"amount": 100,
"currency": "EUR",
"description": "Test transaction ütf",
"tracking_id": "tracking_id_000",
"billing_address": {
"phone": "123"
},
"credit_card": {
"number": "4012001037141112",
"verification_value": "123",
"exp_month": "01",
"exp_year": "2027",
"holder": "John Doe"
},
"recipient_card": {
"number": "4200000000000000",
"holder": "Mary Doe"
},
"customer": {
"ip": "127.0.0.1",
"device_id": "12312312321fff67",
"email": "[email protected]"
},
"sender_billing_address": {
"first_name": "John",
"last_name": "Doe",
"country": "PL",
"city": "Warsaw",
"address": "Gilbert 104"
},
"recipient_billing_address": {
"first_name": "Mary",
"last_name": "Doe",
"country": "PL",
"city": "Warsaw",
"address": "Gilbert 104"
},
"additional_data": {
"referer": "https://example.com/server/cs_post/post.php?order_id=5304380&security=949247¤cy=USD"
}
}
}
Response parameters
Response parameters replicate request parameters, except for the additional ones:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example of the response in case P2P transfer requires 3-D Secure verification
{
"transaction": {
"uid": "1-82cc07d15d",
"status": "incomplete",
"amount": 100,
"currency": "EUR",
"description": "Test transaction ütf",
"type": "p2p",
"payment_method_type": "credit_card",
"tracking_id": "tracking_id_000",
"message": null,
"test": false,
"created_at": "2021-06-08T09:28:18.073Z",
"updated_at": "2021-06-08T09:28:20.280Z",
"paid_at": null,
"language": "en",
"redirect_url": "http://127.0.0.1:9887/process/1-82cc07d15d",
"credit_card": {
"holder": "John Doe",
"stamp": "9723c73562cf57c89e162d7adaad7cff30d2fa9364b45063cd4ccfe980a38c53",
"brand": "visa",
"last_4": "1112",
"first_1": "4",
"bin": "401200",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": 1,
"exp_year": 2027,
"token_provider": null,
"token": null
},
"recipient_card": {
"holder": "Mary Doe",
"stamp": "9723c73562cf57c89e162d7adaad7cff30d2fa9364b45063cd4ccfe980a38c53",
"brand": "visa",
"last_4": "0000",
"first_1": "4",
"bin": "420000",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": null,
"exp_year": null,
"token_provider": null,
"token": null
},
"receipt_url": "https://admin.pay-cross.com/customer/transactions/1-82cc07d15d/89caa14443680985ce8ac2452fb9f82b4947926ff5bce0f15a7b4c4d0834ea5d",
"recipient_billing_address": {
"first_name": "Mary",
"last_name": "Doe",
"address": "Gilbert 104",
"country": "PL",
"city": "Warsaw",
"zip": null,
"state": null,
"phone": null
},
"sender_billing_address": {
"first_name": "John",
"last_name": "Doe",
"address": "Gilbert 104",
"country": "PL",
"city": "Warsaw",
"zip": null,
"state": null,
"phone": null
},
"status_code": null,
"id": "1-82cc07d15d",
"verify_p2p": {
"status": "successful",
"message": "3DS",
"amount": 100,
"currency": "EUR",
"bank_fee": null,
"required_fields": null
},
"p2p": {
"ref_id": null,
"message": null,
"amount": 100,
"currency": "EUR",
"billing_descriptor": null,
"gateway_id": 1,
"status": "incomplete",
"auth_code": null,
"rrn": null,
"bank_code": null
},
"customer": {
"ip": "127.0.0.1",
"email": "[email protected]",
"device_id": "12312312321fff67",
"birth_date": null
},
"additional_data": {
"referer": "https://example.com/server/cs_post/post.php?order_id=5304380&security=949247¤cy=USD"
}
}
}
Example of the response in case P2P transfer is successfully completed
{
"transaction": {
"uid": "1-4f4db7559d",
"status": "successful",
"amount": 100,
"currency": "EUR",
"description": "Test transaction ütf",
"type": "p2p",
"payment_method_type": "credit_card",
"tracking_id": "tracking_id_000",
"message": "Successfully processed",
"test": false,
"created_at": "2021-06-08T11:54:11.725Z",
"updated_at": "2021-06-08T11:54:39.219Z",
"paid_at": "2021-06-08T11:54:39.203Z",
"language": "en",
"redirect_url": "http://127.0.0.1:9887/process/1-4f4db7559d",
"credit_card": {
"holder": "John Doe",
"stamp": "9723c73562cf57c89e162d7adaad7cff30d2fa9364b45063cd4ccfe980a38c53",
"brand": "visa",
"last_4": "1112",
"first_1": "4",
"bin": "401200",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": 1,
"exp_year": 2027,
"token_provider": null,
"token": null
},
"recipient_card": {
"holder": "Mary Doe",
"stamp": "9723c73562cf57c89e162d7adaad7cff30d2fa9364b45063cd4ccfe980a38c53",
"brand": "visa",
"last_4": "0000",
"first_1": "4",
"bin": "420000",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": null,
"exp_year": null,
"token_provider": null,
"token": null
},
"receipt_url": "https://admin.pay-cross.com/customer/transactions/1-4f4db7559d/1b653d8b2c18f48a17b88435ca51e7b22bb69e5080a400faa40e3918ae6552d7",
"recipient_billing_address": {
"first_name": "Mary",
"last_name": "Doe",
"address": "Gilbert 104",
"country": "PL",
"city": "Warsaw",
"zip": null,
"state": null,
"phone": null
},
"sender_billing_address": {
"first_name": "John",
"last_name": "Doe",
"address": "Gilbert 104",
"country": "PL",
"city": "Warsaw",
"zip": null,
"state": null,
"phone": null
},
"status_code": null,
"id": "1-4f4db7559d",
"verify_p2p": {
"status": "successful",
"message": "3DS",
"amount": 100,
"currency": "EUR",
"bank_fee": null,
"required_fields": null
},
"p2p": {
"ref_id": "000005800042000145210608125426&000005800042000146210608125433",
"message": "Approved",
"amount": 100,
"currency": "EUR",
"billing_descriptor": null,
"gateway_id": 1,
"status": "successful",
"auth_code": null,
"rrn": null,
"bank_code": null
},
"customer": {
"ip": "127.0.0.1",
"email": "[email protected]",
"device_id": "12312312321fff67",
"birth_date": null
}
}
}
Example of the response in case P2P transfer is not successfully completed
{
"transaction": {
"uid": "1-d8d4cd2503",
"status": "failed",
"amount": 100,
"currency": "EUR",
"description": "Test transaction ütf",
"type": "p2p",
"payment_method_type": "credit_card",
"tracking_id": "tracking_id_000",
"message": "Failed",
"test": false,
"created_at": "2021-06-08T11:48:15.002Z",
"updated_at": "2021-06-08T11:48:15.165Z",
"paid_at": null,
"language": "en",
"redirect_url": "http://127.0.0.1:9887/process/1-d8d4cd2503",
"credit_card": {
"holder": "John Doe",
"stamp": "9723c73562cf57c89e162d7adaad7cff30d2fa9364b45063cd4ccfe980a38c53",
"brand": "visa",
"last_4": "1112",
"first_1": "4",
"bin": "401200",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": 1,
"exp_year": 2027,
"token_provider": null,
"token": null
},
"recipient_card": {
"holder": "Mary Doe",
"stamp": "9723c73562cf57c89e162d7adaad7cff30d2fa9364b45063cd4ccfe980a38c53",
"brand": "visa",
"last_4": "0000",
"first_1": "4",
"bin": "420000",
"issuer_country": null,
"issuer_name": null,
"product": null,
"exp_month": null,
"exp_year": null,
"token_provider": null,
"token": null
},
"receipt_url": "https://admin.pay-cross.com/customer/transactions/1-d8d4cd2503/047da8244b961a41b5ad52e138dd8b866e6e6e773c3510ec1eb1476192b62397",
"recipient_billing_address": {
"first_name": "Mary",
"last_name": "Doe",
"address": "Gilbert 104",
"country": "PL",
"city": "Warsaw",
"zip": null,
"state": null,
"phone": null
},
"sender_billing_address": {
"first_name": "John",
"last_name": "Doe",
"address": "Gilbert 104",
"country": "PL",
"city": "Warsaw",
"zip": null,
"state": null,
"phone": null
},
"status_code": null,
"id": "1-d8d4cd2503",
"verify_p2p": {
"status": "failed",
"message": "3DS",
"amount": 100,
"currency": "EUR",
"bank_fee": null,
"required_fields": null
},
"p2p": {
"ref_id": null,
"message": null,
"amount": 100,
"currency": "EUR",
"billing_descriptor": null,
"gateway_id": 1,
"status": "incomplete",
"auth_code": null,
"rrn": null,
"bank_code": null
},
"customer": {
"ip": "127.0.0.1",
"email": "[email protected]",
"device_id": "12312312321fff67",
"birth_date": null
}
}
}
3-D Secure verification
The source card 3-D Secure verification process is identical with the card verification process for the authorization or payment operations.