Skip to main content
POST
/
one-time-payment
Create a one-time-payment link
curl --request POST \
  --url https://demo.api.harmony.compago.com/api/one-time-payment \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "amount": "100.00",
  "currency": "MXN",
  "externalId": "tracking-id-from-your-system",
  "description": "Lorem ipsum dolor sit amet",
  "homepageUrl": "https://app.compago.com/",
  "redirectUrl": "https://app.compago.com/",
  "billingInformation": {
    "email": "[email protected]",
    "firstName": "John",
    "lastName": "Doe",
    "phoneNumber": "+521234567890",
    "address": {
      "addressLine": "123 Main St",
      "city": "Los Angeles",
      "state": "California",
      "zip": "12345"
    }
  }
}
'
{
  "redirectUrl": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Request body for creating a one-time payment link. You can redirect the user to the resulting URL to complete the payment, the payment will be processed by the Compago platform, and then the user will be redirected back to the homepage URL provided.

amount
number<decimal>
required

The amount to be charged for the one-time payment. Must be a positive number.

Example:

"100.00"

currency
enum<string>
required
Available options:
MXN,
USD
Example:

"MXN"

externalId
string
required

Optional external ID to track the payment in your system. Must be unique for each payment.

Example:

"tracking-id-from-your-system"

description
string
required

A description of the payment. This will be displayed to the user during the payment process.

Example:

"Lorem ipsum dolor sit amet"

homepageUrl
string<uri>
required

The homepage URL of your application to link the user back to your application in case they cancel the payment or want to go back. This should be a valid URL that your application can handle.

Example:

"https://app.compago.com/"

redirectUrl
string<uri>
required

The URL of your application to redirect the user back to after the payment is completed. This should be a valid URL that your application can handle.

Example:

"https://app.compago.com/"

billingInformation
object

Billing information for the one-time payment

Response

Link successfully created

redirectUrl
string<uri>
required