API Reference

The Create a Charge endpoint in the Wudi Pay API allows users to generate and initiate a new financial charge.

🚧

HEADERS

Authorization (string, required): The access token generated by the authentication endpoint must be included in the authorization header in the format Bearer {{access_token}}.

Charge Status

  • PENDING: The charge has been created and is awaiting payment from the customer.
  • PAID: The charge has been successfully paid by the customer.
  • REFUNDED: The transaction has been refunded to the customer.
  • FAILED: The charge was failed because payer is in “receiver blocklist”. Anti-Fraud reasons.
  • EXPIRED: The charge was not paid within the validity period and has expired, becoming invalid.

🟢

How to Create a txid

The TXID must be unique for each transaction to avoid conflicts. A good practice is to generate a TXID by combining a specific prefix (such as "TX" for transactions) with a programmatically generated unique identifier, such as a random alphanumeric code.

To create a TXID, follow these steps:

  • Choose a Prefix: Use a prefix that clearly identifies the nature of the identifier, for example, "TX" for transactions.
  • Generate a Unique Identifier: Combine the prefix with a programmatically generated unique identifier. This identifier should be alphanumeric, between 26 and 35 characters long, and must not contain special characters, periods, spaces, dashes, slashes, etc. In other words, it should consist of letters and numbers only.

➡️

Practical Tips

  • Parameter Validation: Ensure that the txid, amount, and expiration parameters are valid and meet the endpoint requirements before sending the request.
  • Testing: Perform testing in a sandbox environment before using the endpoint in production to ensure the integration is working correctly.
  • Expiration: is the charge expiration time in seconds. This parameter defines how long the charge will be valid before expiring.
Language
Authorization
Header
Click Try It! to start a request and see the response here!