Create a new payment.
Given an amount (in USD or raw nano), returns a payment identifier (used to track the payment in the Madora system) and a nano address to serve as the destination for the payee. The response contains payment amounts, payment address, and a unique identifier created by Madora to refer to the payment later. Payments will fail if the user does not complete them within 15 minutes, and a new payment will need to be created. As part of Madora's AML policy, payments may not exceed $600. Additionally, payments are only available in supported regions.
Body
-
usdAmount string
Payment amount in USD. Required if nanoAmount is not provided.
-
nanoAmount string
Payment amount in Nano (Raw). Required if usdAmount is not provided.
-
orderId string
Optional identifier for the transaction for merchant use. Not used by Madora.
-
orderDescription string
Optional description for the transaction for merchant use. Not used by Madora.
-
paymentCustomer object
KYC (Know Your Customer) information used as part of Madora's required Anti-Money Laundering practices. Address information uses the Drupal Address Field (https://www.drupal.org/project/addressfield) to allow international address inputs. This means many fields will be optional for addresses in a given country. Descriptions provided describe the usage in a United States-based address. Other countries should use best judgement, or contact support@madora.io for best practices.
curl \
-X POST https://madora.io/api/payments/create-payment \
--user "username:password" \
-H "Content-Type: application/json" \
-d '{"usdAmount":"2.05","nanoAmount":"1000000000000000000000000000000","orderId":"1","orderDescription":"test transaction","paymentCustomer":{"firstName":"John","lastName":"Doe","email":"support@madora.io","organizationName":"Madora","country":"US","administrativeArea":"MA","subAdministrativeArea":"string","locality":"Boston","dependentLocality":"string","postalCode":"02133","thoroughfare":"24 Beacon St","premise":"string","subPremise":"string","phoneNumber":"+16177222000"}}'
{
"usdAmount": "2.05",
"nanoAmount": "1000000000000000000000000000000",
"orderId": "1",
"orderDescription": "test transaction",
"paymentCustomer": {
"firstName": "John",
"lastName": "Doe",
"email": "support@madora.io",
"organizationName": "Madora",
"country": "US",
"administrativeArea": "MA",
"subAdministrativeArea": "string",
"locality": "Boston",
"dependentLocality": "string",
"postalCode": "02133",
"thoroughfare": "24 Beacon St",
"premise": "string",
"subPremise": "string",
"phoneNumber": "+16177222000"
}
}
{
"usdAmount": "2.05",
"nanoAmount": "1000000000000000000000000000000",
"orderId": "1",
"orderDescription": "test transaction",
"paymentCustomer": {
"firstName": "John",
"lastName": "Doe",
"email": "support@madora.io",
"organizationName": "Madora",
"country": "US",
"administrativeArea": "MA",
"subAdministrativeArea": "string",
"locality": "Boston",
"dependentLocality": "string",
"postalCode": "02133",
"thoroughfare": "24 Beacon St",
"premise": "string",
"subPremise": "string",
"phoneNumber": "+16177222000"
}
}
{
"paymentIdentifier": "f390682f-4ded-41d6-adfd-80c54e85d73f",
"usdAmount": 2.05,
"rawNanoAmount": "1000000000000000000000000000000",
"friendlyNanoAmount": "1.000000",
"paymentAddress": "nano_3g6ue89jij6bxaz3hodne1c7gzgw77xawpdz4p38siu145u3u17c46or4jeu"
}
{
"paymentIdentifier": "f390682f-4ded-41d6-adfd-80c54e85d73f",
"usdAmount": 2.05,
"rawNanoAmount": "1000000000000000000000000000000",
"friendlyNanoAmount": "1.000000",
"paymentAddress": "nano_3g6ue89jij6bxaz3hodne1c7gzgw77xawpdz4p38siu145u3u17c46or4jeu"
}
{
"errorCode": "internal",
"errorMessage": "string"
}
{
"errorCode": "internal",
"errorMessage": "string"
}
{
"errorCode": "internal",
"errorMessage": "string"
}
{
"errorCode": "internal",
"errorMessage": "string"
}
{
"errorCode": "internal",
"errorMessage": "string"
}
{
"errorCode": "internal",
"errorMessage": "string"
}