Main Endpoints

Payments

Create Payment

HTTP Method: POST
Endpoint URL: /payment
Description: Creates a new payment.
Security: Requires the API-KEY and X-HMAC headers.

Request Body (JSON):

{
	"amount": "1000.00",
	"asset": { "short": "USDT", "network": "tron" },
	"customer": {
		"id": 12312312,
		"name": "John Dou",
		"email": "[email protected]"
	},
	"invoice": "INV-001",
	"checkoutUrl": "https://abc.com/orders/40113049"
}

Example Request:

POST https://api-v2.afipay.io/v2/payment HTTP/1.1
Content-Type: application/json
API-KEY: your_API-KEY
X-HMAC: your_hmac_signature

{
	"amount": "1000.00",
	"asset": { "short": "USDT", "network": "tron" },
	"customer": {
		"id": 12312312,
		"name": "John Dou",
		"email": "[email protected]"
	},
	"invoice": "INV-001",
	"checkoutUrl": "https://abc.com/orders/40113049"
}

Successful Response (200 OK):

{
	"id": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
	"transactions": [
		{
			"paymentId": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
			"txnId": "0xe7238caa68382485141be0443d6ba7efd0bd9f6bac5a624bd059acc53af1bf1d19",
			"receivedAmount": "20.00",
			"asset": {
				"short": "USDT",
				"name": "Tether",
				"logoUrl": "https://cryptologos.cc/logos/tether-usdt-logo.png",
				"network": "tron"
			},
			"destTag": null,
			"addressFrom": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
			"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
			"date": "2017-07-21T17:32:28Z"
		}
	],
	"amount": "100.00",
	"totalReceivedAmount": "20.00",
	"asset": {
		"short": "USDT",
		"name": "Tether",
		"logoUrl": "https://cryptologos.cc/logos/tether-usdt-logo.png",
		"network": "tron"
	},
	"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
	"confirmsNeeded": 10,
	"timeout": 9000,
	"checkoutUrl": "https://www.merchant.com/",
	"status": "OPEN",
	"customer": {
	"id": 12312312,
	"name": "John Dou",
	"email": "[email protected]"
	},
	"merchant": {
		"id": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
		"name": "Company Name",
		"siteUrl": "company.com",
		"logoUrl": "https://example.com/logo.svg",
		"email": "[email protected]"
	},
	"invoice": "INV-001",
	"paymentRedirectUrl": "https://a-pay-system.com/en/invoice?id=285d8dce-7663-4580-ba7f-8afb2f2d3292",
	"createdAt": "2017-07-21T17:32:28Z",
	"updatedAt": "2017-07-21T17:32:28Z"
}

3.1.2. Get Payments

HTTP Method: GET
Endpoint URL: /payment
Description: Retrieves a list of payments filtered by parameters (e.g., txnIds, ids, invoices, or statuses).
Security: Requires the API-KEY header.

Query Parameters:

  • txnIds: Array of transaction IDs (e.g., [123, 456])
  • ids: Array of payment IDs (e.g., ["id1", "id2"])
  • invoices: Array of invoice strings (e.g., ["INV-001"])
  • statuses: Array of payment statuses (allowed values: OPEN, EXPIRED)
  • page: Number (minimum 1, e.g., 1)
  • limit: Number (between 1 and 100, default is 20)

Example Request:

GET https://api-v2.afipay.io/v2/payment?statuses=OPEN&page=1&limit=20 HTTP/1.1
API-KEY: your_API-KEY

3.1.3. Get Payment

HTTP Method: GET Endpoint URL: /payment/:id Description: Allows obtaining a specific payment. Security: Requires the API-KEY header.

Example Request:

GET https://api-v2.afipay.io/v2/payment/0520de32-2340-4ba8-8b8a-3052b69ae55c HTTP/1.1
API-KEY: your_API-KEY

Withdrawals

Create Withdrawal

HTTP Method: POST
Endpoint URL: /withdrawal
Description: Creates a new withdrawal request.
Security: Requires the API-KEY and X-HMAC headers.

Request Body (JSON):

{
	"amount": "1000.12345678",
	"asset": { "short": "USDT", "network": "tron" },
	"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
	"customer": {
		"id": 12312312,
		"name": "John Dou",
		"email": "[email protected]"
	},
	"destTag": "optional_tag",
	"invoice": "INV-001"
}

Example Request:

POST https://api-v2.afipay.io/v2/withdrawal HTTP/1.1
Content-Type: application/json
API-KEY: your_API-KEY
X-HMAC: your_hmac_signature

{
	"amount": "1000.12345678",
	"asset": { "short": "USDT", "network": "tron" },
	"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
	"customer": {
		"id": 12312312,
		"name": "John Dou",
		"email": "[email protected]"
	},
	"destTag": "optional_tag",
	"invoice": "INV-001"
}

Successful Response (200 OK):

{
	"id": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
	"txnId": "0xe7238caa68382485141be0443d6ba7efd0bd9f6bac5a624bd059acc53af1bf1d19",
	"amount": "1.00000000",
	"receivedAmount": "1.00000000",
	"asset": {
		"short": "USDT",
		"name": "Tether",
		"logoUrl": "https://cryptologos.cc/logos/tether-usdt-logo.png",
		"network": "tron"
	},
	"addressTo": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
	"addressFrom": "0x5D8D9C7f68A46634BCEaD2a6FF166A0BdFb08540",
	"destTag": "optional_tag",
	"status": "OPEN",
	"customer": {
		"id": 12312312,
		"name": "John Dou",
		"email": "[email protected]"
	},
	"merchant": {
		"id": "285d8dce-7663-4580-ba7f-8afb2f2d3292",
		"name": "Company Name",
		"siteUrl": "company.com",
		"logoUrl": "https://example.com/logo.svg",
		"email": "[email protected]"
	},
	"invoice": "INV-001",
	"createdAt": "2017-07-21T17:32:28Z",
	"updatedAt": "2017-07-21T17:32:28Z"
}

Get Withdrawals

HTTP Method: GET
Endpoint URL: /withdrawal
Description: Retrieves a list of withdrawal requests filtered by parameters (e.g., txnIds, ids, invoices, or statuses).
Security: Requires the API-KEY header.

Query Parameters:

  • txnIds: Array of transaction IDs (e.g., ["txn1", "txn2"])
  • ids: Array of withdrawal IDs (e.g., ["id1", "id2"])
  • invoices: Array of invoice strings (e.g., ["INV-001"])
  • statuses: Array of withdrawal statuses (allowed values: CANCELLED, OPEN, APPROVED, COMPLETE)
  • page: Number (minimum 0, e.g., 0)
  • limit: Number (between 1 and 100, default is 20)

Example Request:

GET https://api-v2.afipay.io/v2/withdrawal?statuses=OPEN&page=0&limit=20 HTTP/1.1
API-KEY: your_API-KEY

Get Withdrawal

HTTP Method: GET Endpoint URL: /withdrawal/:id Description: Allows obtaining a specific withdrawal. Security: Requires the API-KEY header.

Example Request:

GET https://api-v2.afipay.io/v2/withdrawal/0520de32-2340-4ba8-8b8a-3052b69ae55c HTTP/1.1
API-KEY: your_API-KEY

Was this page helpful?