Payments

Payments consists in provide order items/payments information, and payment actions.


GET/api/v1/orders/{order_id}/payments

Payments

This endpoint brings items/payments information of an order.

URL attributes

  • Name
    order_id
    Type
    string required
    Description

    The order id.

Request

GET
/api/v1/orders/{order_id}/payments
  curl --request GET \
    --url https://app.collateralxp/com/api/v1/orders/{order_id}/payments \
    --header 'x-api-key: {api_key}' \

Response

  {
    "balance": "$0.00",
    "input_credit_card_link": "https://app.collateralxp.com/invoices/{invoice_id}/edit",
    "items": [
      {
        "amount": "$450.00",
        "product_name": "CONV SFR (FNMA 1004 URAR)"
      }
    ],
    "payments": [
      {
        "amount": "$450.00",
        "confirmed_at": "02/14/2023",
        "created_at": "02/14/2023",
        "method": "credit_card",
        "paid_by": "Paid with **** 2976",
        "receipt_link": "https://app.collateralxp.com/rails/active_storage/blobs/redirect/{blob}/receipt.pdf?disposition=inline"
      }
    ],
    "pdf_link": "https://app.collateralxp.com/rails/active_storage/blobs/redirect/{blob}/invoice.pdf?disposition=inline",
    "total": "$450.00",
    "total_paid": "$450.00"
  }

POST/api/v1/orders/{order_id}/send_payment_link

This endpoint provide the send payment link action.

URL attributes

  • Name
    order_id
    Type
    string required
    Description

    The order id.

Form attributes

  • Name
    email
    Type
    array of strings
    Description

    Email collection to receive the payment link

Request

POST
/api/v1/orders/{order_id}/payments
  curl --request POST \
    --url https://app.collateralxp.com/api/v1/orders/{order_id}/send_payment_link \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: {api_key}' \
    --data '{
      "emails": ["foo@email.com", "bar@email.com", "baz@email.com"]
    }'

Response

  {
    "success": true
  }

PATCH/api/v1/orders/{order_id}/update_payment_method

Update payment method

With this endpoint it's possible to update the order payment method.

URL attributes

  • Name
    order_id
    Type
    string required
    Description

    The order id.

Form attributes

  • Name
    payment_method
    Type
    string
    Description

    The desired payment method, options: 'credit_card', 'invoice', 'payment_link'

Request

PATCH
/api/v1/orders/{order_id}/payments
  curl --request PATCH \
    --url https://app.collateralxp.com/api/v1/orders/{order_id}/update_payment_method \
    --header 'Content-Type: application/json' \
    --header 'x-api-key: {api_key}' \
    --data '{
      "payment_method": "credit_card"
    }'

Response

  {
    "success": true
  }