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,
  "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": "María",
    "lastName": "González",
    "phoneNumber": "+5215512345678",
    "address": {
      "addressLine": "Av. Insurgentes Sur 1234",
      "city": "Ciudad de México",
      "state": "CDMX",
      "zip": "03100"
    }
  },
  "ttlMinutes": 1440
}
'
{
  "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

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

ttlMinutes
integer

Optional time-to-live in minutes for the payment link. Minimum 10 minutes, maximum 2,880 minutes (48 hours). Defaults to 48 hours if not specified.

Required range: 10 <= x <= 2880
Example:

1440

Response

Link successfully created

redirectUrl
string<uri>
required