💸Expected Payments
An Expected Payment belongs to a Product. On this object you set how much you want to charge, and what you want the checkout description to say.
Create an Expected Payment 💵
URL Path
POST
/products/:product_id/expected_payments
- Create an expected payment programmatically via the Pay.so API.
Parameters
Required fields are marked in bold and with an asterisk.
Don't forget to include the headers!
product_id *
:string
The ID of the Product (pass this in as a URL parameter) .description *
:string
The description of the charge you want the customer to see on the checkout.dollar_amount *
:decimal
The amount in USD you want to charge the user. Pay.so will handle the conversation to crypto amounts for you. Not required and will default tonull
if the Product'sopen_amount
attribute is set totrue.
email
:string
The email address of the customer. This will be pre-filled at checkout and can be modified by the customer.metadata
:string
Anything you put here will be returned - unmodified - in the webhook payload. An example use would be to set this is to{ "customer_id": 123 }
so you can match the payment with customers in your database. You can encrypt the metadata using a key only you know, if you want to keep this data completely private. Please note, you must ensure the metadata value is in JSON. A raw example would be "{\"customer_id\":123}".
You must nest the description
and dollar_amount
params under an "expected_payment" key.
See the example request below ⬇️
Example Request
Response
It's normal for email
and address
to be null
at this stage. The customer will fill in this data during checkout.
Update an Expected Payment ✍️
URL Path
PATCH
/products/:product_id/expected_payments/:expected_payment_id
- Expire/re-enable an Expected Payment.
Parameters
Required fields are marked in bold and with an asterisk.
Don't forget to include the headers!
product_id *
:string
The ID of the Product (sent in URL) .expected_payment_id *
:string
The ID of the Expected Payment (sent in URL) .expired *
:boolean
Whether you want the charge to still be payable or not.
You must nest the expired
param under an "expected_payment" key.
See the example request below ⬇️
Example Request
Response
Last updated