Payment API Reference

This API reference provides information on available endpoints for fetching payments and payment methods.

The Payment model

Payments serve as transactions between businesses and customers, allowing the settlement of invoices. Customers have the option to make payments for invoices, while businesses can send payment receipts upon successful transactions. This process streamlines financial interactions, ensuring a clear record of completed transactions.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the payment.

  • Name
    payment_number
    Type
    string
    Description

    The payment number.

  • Name
    payment_date
    Type
    integer
    Description

    The date of the payment.

  • Name
    notes
    Type
    string
    Description

    The notes of the payment.

  • Name
    amount
    Type
    integer
    Description

    The amount of the payment.

  • Name
    status
    Type
    string
    Description

    The status of the payment.

  • Name
    invoice_id
    Type
    string
    Description

    The ID of the invoice.

  • Name
    business_id
    Type
    string
    Description

    The ID of the business.

  • Name
    payment_method_id
    Type
    string
    Description

    The ID of the payment method.

  • Name
    customer_id
    Type
    string
    Description

    The ID of the customer.

  • Name
    provider_intent_id
    Type
    string
    Description

    The ID of the provider intent.

  • Name
    sequence_number
    Type
    integer
    Description

    The sequence number of the payment.

  • Name
    payment_pdf_url
    Type
    string
    Description

    The URL of the payment PDF.

  • Name
    attachments
    Type
    array
    Description

    The attachments of the payment.

  • Name
    customer
    Type
    object
    Description

    The customer of the payment.

  • Name
    business
    Type
    object
    Description

    The business of the payment.

  • Name
    invoice
    Type
    object
    Description

    The invoice of the payment.

  • Name
    payment_method
    Type
    object
    Description

    The payment method of the payment.

  • Name
    payment_type
    Type
    string
    Description

    The type of the payment.

  • Name
    created_at
    Type
    integer
    Description

    The creation date of the payment.


POSTapi/v2/payments/{id}/send-receipt

Send payment receipt

This endpoint allows you to mail the payment receipt to the corresponding customer's email address.

Parameters

  • Name
    payment_id
    Type
    integer
    Description

    The ID of the payment.

Optional Parameters

  • Name
    subject
    Type
    string
    Description

    Subject of the email.

  • Name
    body
    Type
    string
    Description

    Body of the email.

  • Name
    reply_to
    Type
    string
    Description

    Reply to email address.

  • Name
    to
    Type
    string
    Description

    Email address of the recipient.

Request

POST
api/v2/payments/{id}/send-receipt
curl --request POST \
  "https://payments.your-domain.com/api/v2/payments/99783bf4-c49a-45d3-abc6-118ad6c80f34/send-receipt" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
  --data "{
    \"subject\": \"You have received new payment receipt by {VENDOR_BUSINESS_NAME}\",
    \"body\": \"<p>Thank you for the payment.</p><p>Please view your payment receipt using the button below:</p>.\",
    \"reply_to\": \"business_email@example.com\",
    \"to\": \"customer_email@example.com\"
  }"

Response

{
  "data": {
    "id": "99783bf4-c49a-45d3-abc6-118ad6c80f34",
    "payment_number": "PAY-000001",
    "payment_date": 514339200,
    "notes": "Assumenda quo reprehenderit ipsum ullam.",
    "amount": 100,
    "status": "PAID",
    "invoice_id": "9aae0110-a4d6-4552-99de-4b4d3e3432f8",
    "business_id": "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
    "payment_method_id": "99783bf4-b652-4e06-a0a2-32d1eb1018c9",
    "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
    "provider_intent_id": "pi_3OZCFRHphok22dPx1bVVta5fr",
    "sequence_number": 1,
    "payment_pdf_url": "https://payments.your-domain.com/payments/pdf/99783bf4-c49a-45d3-abc6-118ad6c80f34",
    "attachments": [],
    "customer": {},
    "business": {},
    "invoice": {},
    "payment_method": {
      "id": "99783bf4-b652-4e06-a0a2-32d1eb1018c9",
      "name": "Credit Card",
      "business_id": "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      "type": "GENERAL"
    },
    "payment_type": "outgoing",
    "created_at": 1687416810
  }
}

GETapi/v2/payments

List all payments

This endpoint returns a list of your payments.

Parameters

  • Name
    limit
    Type
    integer
    Description

    A limit on the number of payments to be returned on a single page.

  • Name
    page
    Type
    integer
    Description

    Page number (for pagination).

  • Name
    payment_number
    Type
    integer
    Description

    Filter records by payment_number.

  • Name
    customer_id
    Type
    string
    Description

    Filter records by customer_id.

  • Name
    payment_method_id
    Type
    string
    Description

    Filter records by payment_method_id.

Request

GET
api/v2/payments
curl --request GET \
  --get "https://payments.your-domain.com/api/v2/payments" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data": [
    {
      "id": "99783bf4-c49a-45d3-abc6-118ad6c80f34",
      "payment_number": "PAY-000001",
      "payment_date": 514339200,
      "notes": "Assumenda quo reprehenderit ipsum ullam.",
      "amount": 100,
      "status": "PAID",
      "invoice_id": "9aae0110-a4d6-4552-99de-4b4d3e3432f8",
      "business_id": "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      "payment_method_id": "99783bf4-b652-4e06-a0a2-32d1eb1018c9",
      "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
      "provider_intent_id": "pi_3OZCFRHphok22dPx1bVVta5fr",
      "sequence_number": 1,
      "payment_pdf_url": "https://payments.your-domain.com/payments/pdf/99783bf4-c49a-45d3-abc6-118ad6c80f34",
      "attachments": [],
      "customer": {},
      "business": {},
      "invoice": {},
      "payment_method": {
        "id": "99783bf4-b652-4e06-a0a2-32d1eb1018c9",
        "name": "Credit Card",
        "business_id": "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
        "type": "GENERAL"
      },
      "payment_type": "outgoing",
      "created_at": 1687416810
    },
    {...}
  ]
}

GETapi/v2/payments/{id}

Retrieve a payment

This endpoint allows you to retrieve a Payment object.

Parameters

  • Name
    id
    Type
    integer
    Description

    The ID of the payment.

Request

GET
api/v2/payments/{id}
curl --request GET \
  --get "https://payments.your-domain.com/api/v2/payments/99783bf4-c49a-45d3-abc6-118ad6c80f34" \
  --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --header "business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Response

{
  "data": {
    "id": "99783bf4-c49a-45d3-abc6-118ad6c80f34",
    "payment_number": "PAY-000001",
    "payment_date": 514339200,
    "notes": "Assumenda quo reprehenderit ipsum ullam.",
    "amount": 100,
    "status": "PAID",
    "invoice_id": "9aae0110-a4d6-4552-99de-4b4d3e3432f8",
    "business_id": "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
    "payment_method_id": "99783bf4-b652-4e06-a0a2-32d1eb1018c9",
    "customer_id": "98ed68ce-6964-4c2a-9430-8a849e373c52",
    "provider_intent_id": "pi_3OZCFRHphok22dPx1bVVta5fr",
    "sequence_number": 1,
    "payment_pdf_url": "https://payments.your-domain.com/payments/pdf/99783bf4-c49a-45d3-abc6-118ad6c80f34",
    "attachments": [],
    "customer": {},
    "business": {},
    "invoice": {},
    "payment_method": {
      "id": "99783bf4-b652-4e06-a0a2-32d1eb1018c9",
      "name": "Credit Card",
      "business_id": "995c98ce-cdd9-4ef6-b018-9c696cb07e9d",
      "type": "GENERAL"
    },
    "payment_type": "outgoing",
    "created_at": 1687416810
  }
}