Providers
Providers are payment systems with which merchants can collaborate. Any merchant can provide providers validation URL and before each transaction processing Aggregator will send request to this endpoint with list of providers so merchant can choose which providers will be available for each specific client. Also, right before creating transaction Aggregator can call transaction validation URL, so merchant can check if client is allowed to make such transaction, including if he can use chosen provider. All those endpoints description is written below.
Supported providers
Please contact us to get the full list of supported providers.
Available providers validation
POST
providers validation URL(specified by merchant)Description: Get providers available for specific client.
Request:
{ "transactionData": { "merchantData": { "merchantHash": "string", "clientId": "string", "additionalData": {} }, "paymentData": { "nonce": "string", "amount": decimal, "currency": "string", "providerTags": [ "fiat" ], "providerId": int, "payType": "string" }, "cashIn": bool }, "providers": [ { "id": int, "name": "string", "collabId": int, "currencies": [], "payTypes": [] } ] }transactionData– object that contains all data related to a transaction.merchantData- object that contains data to identify merchant and its' client.merchantData.merchantHash- GUID placed in string. Its' value is provided for each merchant individually, so this will always be used as a constant.merchantData.clientId- unique identifier for each merchant's client.merchantData.additionalData- any data that you put during payment initialization.paymentData– object that contains data needed to process the payment.paymentData.nonce- string with unique transaction stamp. This data is needed to identify transaction and prevent multiple transaction processing in case of multiple triggering the same transaction by merchant.paymentData.amount- decimal value that describes amount of money that will be deposited or withdrawn.paymentData.currency- payment currency.paymentData.providerTags- array of strings that filters available payment providers. If array is empty, all providers are allowed. If array has values, only providers with at least one matching tag will be allowed. merchant can create and assign any tag to providers. By default, the tags "fiat" and "crypto" are created and assigned to the corresponding providers.paymentData.providerId- unique provider's identifier.paymentData.payType- string value that indicates the type of payment. Its value must match one of the predefined payment types provided by the system. Each type is associated with a provider and may support deposit (Cash In), withdrawal (Cash Out), or both.cashIn– boolean value that indicates whether the transaction is a deposit or withdrawal.providers– list of provider objects.providers.id– unique identifier of the provider.providers.name– provider name.providers.collabId– identifier of the collaborator associated with the provider.providers.currencies– list of currencies supported by the provider.providers.payTypes– list of payment types supported by the provider.
Expected response from merchant service:
{ "providers": [ { "id": int, "name": string, "collabId": int, "currencies": [], "payTypes": [] } ], "message": string }id- unique provider's identifier.name– string, name of the provider.collabId– integer, identifier of the collaborator or merchant associated with this provider.currencies– list of currency objects supported by the provider. Each object contains:id– integer, identifier of the currency.code– string, ISO code of the currency (e.g., "USD", "PHP").
payTypes– list of payment type objects supported by the provider. Each object contains:id– integer, unique identifier of the payment type.code– string, internal code of the payment type (e.g., "GCASH_PAY", "MAYA_PAY").name– string, display name of the payment type (e.g., "GCash", "Maya").cashIn– boolean, indicates whether this payment type can be used for deposit (Cash In).cashOut– boolean, indicates whether this payment type can be used for withdrawal (Cash Out).isCashInEnabled– boolean, indicates whether Cash In is currently enabled for this payment type.isCashOutEnabled– boolean, indicates whether Cash Out is currently enabled for this payment type.
message- string value that contains additional information.
Error Response:
{ "message": "string" }
Transaction validation
POST
transaction validation URL(specified by merchant)Description: validate client availability to make such transaction.
Request:
{ "merchantData": { "merchantHash": "string", "clientId": "string", "additionalData": {} }, "paymentData": { "nonce": "string", "amount": decimal, "currency": "string", "providerId": int }, "providerData": {}, "validationId": long, "cashIn": bool }merchantData- object that contains data to identify merchant and its' client.merchantData.merchantHash- GUID placed in string. Its' value is provided for each merchant individually, so this will always be used as a constant.merchantData.clientId- identifier of client on merchant's side.merchantData.additionalData- object with any client's additional data, needed to identify merchant's client or complete his transaction.paymentData– object that contains data needed to process the payment.paymentData.nonce- string with unique transaction stamp. This data is needed to identify transaction and prevent multiple transaction processing in case of multiple triggering the same transaction by merchant.paymentData.amount- decimal value that describes amount of money that will be deposited or withdrawn.paymentData.currency- string that contains ISO-code of currency that will be deposited or withdrawn.paymentData.providerId- Identifier of payment system partner.providerData- object that contains data needed for provider to process transaction.validationId- identifier of current validation operation.cashIn– boolean value that indicates whether the transaction is a deposit or withdrawal.
Expected HTTP response status code:
200- client is allowed to make such transaction (for immediate validation).200- validation request was created on your side (for postponed validation). Then, YaPay will be waiting for validation result. To proceed validation result - callPostponed validationendpoint, described below.403- client is not allowed to make such transaction.
Error Response:
{ "message": "string" }
Postponed validation
If merchant needs transaction validation to be postponed, validation endpoint can be determined as Awaitable and when transaction will finally be validated on merchant's side, merchant can send callback to signalize YaPay about validation result. To perform this - send request to according endpoint.
POST
https://{gateway-api-base-url}/api/v1/transactions/validationDescription: postponed validation of client availability to make such transaction.
Expected request:
{ "validationId": long, "success": bool, "description": string }validationId- identifier of current validation operation.success- boolean value that determines if user was validated successfully to perform transaction.description- string value that contains an explanation of the validation result.
HTTP response status code:
200- validation result was received.403- validation result was already received with different status.
Error Response:
{ "message": "string" }