🎁Products

A Product object holds the basic information about your checkout experience. It holds information about your business name, wallet address, and what Pay.so should do when you receive funds.

Create a Product 🧑‍🔧

URL Path

POST /products Create a product programmatically via the Pay.so API.

Parameters

Required fields are marked in bold and with an asterisk

Don't forget to include the headers!

  • name *: string The name of your product.

  • email *: stringThe email address where you want to receive notifications about payments.

  • send_webhook: boolean Whether you would like to receive a webhook notification when a Resolved Payment is created (defaults tofalse).

  • webhook_url: string Where you would like to receive a POST request when a Resolved Payment is created. Required if send_webhook is true.

  • send_email: boolean Whether you would like to send a plain text email to the customer after completing checkout (defaults to false).

  • email_body: string The email text you would like to include in your email to the customer after they have completed checkout. Required if send_email is true.

  • success_url: string Where to direct your customer upon successful checkout.

  • failure_url: stringWhere to direct your customer if they want to abandon checkout.

  • custom_fields: arrayAny extra information you want to capture during checkout. Valid items are full_name, reference, referrer, company, job_title.

  • active: boolean Whether the checkout is active or not (defaults to false).

  • expires_in_minutes: integer If present, this will set an expiration timer on the checkout and display the timer to the customer. Once expired the user will not be able to complete the checkout and a message will be displayed. The value cannot be less than 5.

  • tax_rate: decimal The tax rate included in the price you will charge (for receipt purposes) (defaults to 0.0).

  • swappable: boolean Whether you want Pay.so to offer a token swap to the buyer if they don't have the requested token (might cause small fluctuations in received amounts but can boost conversion) (defaults to true).

  • open_amount: boolean Whether you want the user to be able to choose the amount they pay (defaults to false).

  • token[blockchain] *: string The blockchain of the token that you would like to accept. Allowed options: ethereum, binance-smart-chain, polygon

  • token[network] *: string The network of the token you would like to accept. Allowed options: mainnet. For testing purposes, you can use testnet but only with the test BUSD contract address listed on the next point.

  • token[address] *: string The contract address of the token you would like to accept. Case sensitive. Must be the contract address for USDC, DAI, USDT, BUSD on the Ethereum, BNB, or Polygon chains. For testing purposes, you can get test tokens from here and use the test BUSD contract address: 0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee.

Supported Tokens

AddressTokenChain

0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

USDC

Ethereum

0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d

USDC

BSC

0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174

USDC

Polygon

0x6B175474E89094C44Da98b954EedeAC495271d0F

DAI

Ethereum

0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3

DAI

BSC

0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063

DAI

Polygon

0xdAC17F958D2ee523a2206206994597C13D831ec7

USDT

Ethereum

0x55d398326f99059fF775485246999027B3197955

USDT

BSC

0xc2132D05D31c914a87C6611C10748AEb04B58e8F

USDT

Polygon

0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56

BUSD

BSC

0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee

BUSD

BSC testnet

You must nest the above params under a product key. Additionally you must nest ["blockchain", "network", "address"] under a token key.

See the example request below ⬇️

Example Request

URL: "https://api.pay.so/api/v1/products",
RequestType: "POST",
Headers:
{
    "Authorization": "Bearer YOUR_API_KEY",
    "X-ADDRESS": "YOUR_WALLET_ADDRESS",
    "Content-Type": "application/json"
},
Body: 
{
    "product": {
        "name": "API TEST 100",
        "email": "chris@pay.so",
        "send_webhook": false,
        "webhook_url": null,
        "send_email": false,
        "email_body": null,
        "success_url": null,
        "failure_url": null,
        "custom_fields": [],
        "active": true,
        "token": {
            "blockchain": "binance-smart-chain",
            "network": "testnet",
            "address": "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee"
        }
    }
}

Response

{
    "product": {
        "id": "a25a4274-8f50-4579-b476-8f35b297d4ad",
        "address_id": "26f8a8d5-9bda-4187-b52e-0e48b8410271",
        "slug": "e0944",
        "email": "chris@pay.so",
        "address": "0x43EF183c84079313fcE6fC65d93e569A2bd4Aafd",
        "name": "API TEST 100",
        "send_email": false,
        "email_body": "",
        "send_webhook": false,
        "webhook_url": null,
        "success_url": "",
        "failure_url": "",
        "active": true,
        "verified_address": false,
        "tax_rate": 0,
        "swappable": true,
        "open_amount": false,
        "tokens": [
            {
                "id": "048b065f-d3a3-4771-a00a-ca364add1a23",
                "symbol": "BUSD",
                "address": "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
                "name": "Binance USD",
                "decimal_count": 18,
                "blockchain": "binance-smart-chain",
                "network": "testnet"
            }
        ],
        "custom_fields": [],
        "updated_at": "2022-04-11T12:53:09.189Z",
        "created_at": "2022-04-11T12:53:09.176Z"
    }
}

Fetch all Products 🎁

URL Path

GET /products - Returns all products created via the API.

Don't forget to include the headers!

Example Request

URL: "https://api.pay.so/api/v1/products",
RequestType: "GET",
Headers:
{
    "Authorization": "Bearer YOUR_API_KEY",
    "X-ADDRESS": "YOUR_WALLET_ADDRESS",
    "Content-Type": "application/json"
}

Response

{
    "products": [
        {
            "id": "a25a4274-8f50-4579-b476-8f35b297d4ad",
            "address_id": "26f8a8d5-9bda-4187-b52e-0e48b8410271",
            "slug": "e0944",
            "email": "chris@pay.so",
            "address": "0x43EF183c84079313fcE6fC65d93e569A2bd4Aafd",
            "name": "API TEST 100",
            "send_email": false,
            "email_body": "",
            "send_webhook": false,
            "webhook_url": null,
            "success_url": "",
            "failure_url": "",
            "active": true,
            "verified_address": false,
            "tax_rate": 0,
            "swappable": true,
            "open_amount": false,
            "tokens": [
                {
                    "id": "048b065f-d3a3-4771-a00a-ca364add1a23",
                    "symbol": "BUSD",
                    "address": "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
                    "name": "Binance USD",
                    "decimal_count": 18,
                    "blockchain": "binance-smart-chain",
                    "network": "testnet"
                }
            ],
            "custom_fields": [],
            "updated_at": "2022-04-11T12:53:09.189Z",
            "created_at": "2022-04-11T12:53:09.176Z"
        },
        {...},
        {...}
    ]
}

Update a Product 🛠️

URL Path

PATCH /product/:product_id - Allows you to enable/disable a product.

Parameters

Required fields are marked in bold and with an asterisk

Don't forget to include the headers and the product_id!

  • active *: boolean Whether you want your Product to be active or not.

You must nest the above params in a "product" hash.

See the example request below ⬇️

Example Request

URL: "https://api.pay.so/api/v1/products/:product_id",
RequestType: "PATCH",
Headers:
{
    "Authorization": "Bearer YOUR_API_KEY",
    "X-ADDRESS": "YOUR_WALLET_ADDRESS",
    "Content-Type": "application/json"
},
Body: 
{
    "product": {
        "active": false
    }
}

Response

{
    "product": {
        "id": "a25a4274-8f50-4579-b476-8f35b297d4ad",
        "address_id": "26f8a8d5-9bda-4187-b52e-0e48b8410271",
        "slug": "e0944",
        "email": "chris@pay.so",
        "address": "0x43EF183c84079313fcE6fC65d93e569A2bd4Aafd",
        "name": "API TEST 100",
        "send_email": false,
        "email_body": "",
        "send_webhook": false,
        "webhook_url": null,
        "success_url": "",
        "failure_url": "",
        "active": false,
        "tax_rate": 0,
        "swappable": true,
        "open_amount": false,
        "tokens": [
            {
                "id": "048b065f-d3a3-4771-a00a-ca364add1a23",
                "symbol": "BUSD",
                "address": "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
                "name": "Binance USD",
                "decimal_count": 18,
                "blockchain": "binance-smart-chain",
                "network": "testnet"
            }
        ],
        "custom_fields": [],
        "updated_at": "2022-04-11T12:53:09.189Z",
        "created_at": "2022-04-11T12:53:09.176Z"
    }
}

Last updated