🤑Resolved Payments

A Resolved Payment is a completed checkout, so represents a payment into your wallet. The payment may have succeeded or failed.

URL Path

GET /products/:product_id/resolved_payments - Returns all Resolved Payments associated with that Product.

Don't forget to include the headers!

Example Request

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

Response

{
    "resolved_payments": [
        {
            "is_test": false,
            "id": "49bb61e1-3254-4eda-bd82-7c4b1043be57",
            "product_id": "4836b53d-f2a2-4f91-8923-facf97a16651",
            "expected_payment_id": "bcb20c9f-62e6-44be-8253-92668e52b4a1",
            "product_secret": "7grsphdpL1N95aSbmkFnhCqD",
            "slug": "ac7ce",
            "dollar_amount": "1.0",
            "metadata": null,
            "user": {
                "email": "chris@pay.so",
                "custom_fields": {
                    "full_name": "Chris Butcher"
                }
            },
            "payment": {
                "expected_token": {
                    "symbol": "BUSD",
                    "address": "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
                    "name": "Binance USD",
                    "decimal_count": 18,
                    "blockchain": "binance-smart-chain",
                    "network": "testnet"
                },
                "received_token": {
                    "symbol": "BUSD",
                    "address": "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
                    "name": "Binance USD",
                    "decimal_count": 18,
                    "blockchain": "binance-smart-chain",
                    "network": "testnet"
                },
                "expected_token_amount": "1.0",
                "received_token_amount": "1.0",
                "amount_difference": "0.0",
                "receiving_address": "0x43EF183c84079313fcE6fC65d93e569A2bd4Aafd",
                "sender_address": "0x84a58511E6a9B6bf6B0218d64D25DD7A354e485C",
                "tx_id": "0x3775b645f54a0c9fc8536848d79eff36e35fd4159e4fa1992217d30fc3b38880",
                "tx_success": true,
                "tx_failure": false,
                "swapped": false,
                "created_at": "2022-02-22T20:40:12.076Z"
            }
        },
        {...},
        {...}
    ]
}

The Resolved Payment object

  • is_test: boolean Whether this is a real Resolved Payment or not. If this is true you should not action the order. All real purchases (successful or failed) will be false.

  • id: The id relating to this payment. You can use this to check for uniqueness and protect against data duplication.

  • product_id: string The id of the Product that this Resolved Payment refers to.

  • expected_payment_id: stringThe id of the Expected Payment that this Resolved Payment refers to.

  • product_secret: string A unique string specific to your Product, only available in API responses from Pay.so. You can use this to be sure the API call originated from Pay.so.

  • slug: stringThe slug of the Product (shown in the URL for your checkout).

  • dollar_amount: decimal The USD equivalent of the charge.

  • user[email]: string The customer's email address

  • user[custom_fields]: array The values of any custom fields that the Product was set to ask for. For example full_name, reference and referrer.

  • expected_token[symbol]: string The symbol of the checkout's selected token.

  • expected_token[address]: stringThe contract address of the checkout's selected token.

  • expected_token[name]: string The name of the checkout's selected token.

  • expected_token[decimal_count]: integer The precision to which the checkout's selected token works to.

  • expected_token[blockchain]: string The name of the blockchain that the checkout's selected token works on.

  • expected_token[network]: string The name of the network that the checkout's selected token works on.

  • received_token[symbol]: string The symbol of the token actually sent by the customer.

  • received_token[address]: stringThe contract address of the token actually sent by the customer.

  • received_token[name]: string The name of the token actually sent by the customer.

  • received_token[decimal_count]: integer The precision to which the token actually sent by the customer works to.

  • received_token[blockchain]: string The name of the blockchain that the token actually sent by the customer works on.

  • received_token[network]: string The name of the network that the token actually sent by the customer works on.

  • expected_token_amount: decimal The number of crypto tokens that Pay.so determined should be charged to match the intended dollar_amount.

  • received_token_amount: decimalThe actual amount of crypto tokens that were sent by the customer.

  • receiving_address: stringThe wallet address that the funds were sent to.

  • sender_address: stringThe wallet address that the funds were sent from.

  • tx_id: stringThe hash of the transaction on the blockchain.

  • tx_success: boolean Will be true if the transaction succeeded.

  • tx_failure: booleanWill be true if the transaction failed.

  • amount_difference: float The percentage difference between expected_token_amount and received_token_amount. A perfect transaction will be 0.0, but some variation can occur, especially if the transaction was swapped. If the difference is greater than 1.0, you may want to arrange a partial refund. If less than -1.0, you may want the user to send the difference before fulfilling the order.

  • swapped: boolean Whether Pay.so performed a token swap for the user. For example, if you request USDC but the buyer only has ETH, Pay.so can take ETH from the user, swap it, and deliver USDC to you. This maximises conversion but can cause a higher amount_difference than usual.

  • created_at: Timestamp of when the Resolved Payment was initiated.

Last updated