Airwallex logo

Billing

Copy for LLMView as Markdown

Simulate billing operations in the sandbox environment.

Endpoints
POST /api/v1/simulation/billing/payment_sources/{id}/fail_next_autocharge

Fail next autocharge

POST /api/v1/simulation/billing/payment_sources/{id}/fail_next_autocharge

Use this endpoint to simulate the failure of the next auto charge execution of a payment source. This will cause the next scheduled auto-charge to fail, allowing you to test error handling and retry logic in your billing workflows. This is only available in the Sandbox environment.

Parameters
idrequiredstring

Unique identifier of the Payment Source object.

Response body - 200 OK
billing_customer_idstring

Unique identifier of the Billing Customer that this Payment Source belongs to.

created_atstring

Time when this Payment Source was created.

external_idstring

Unique identifier of the Payment Consent associated with the Payment Source.

idstring

Unique identifier of the Payment Source object.

linked_payment_account_idstring

Unique identifier of the linked payment account to collect payment. You can find this unique identifier in the Airwallex web app > Settings > Account details, within the Account Information section.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

updated_atstring

Time when this Payment Source was last updated.

Errors
Error statusDescription
400

invalid_argument

401

credentials_invalid

404

not_found

500

service_unavailable

POST /api/v1/simulation/billing/payment_sources/{id}/fail_next_autocharge
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/simulation/billing/payment_sources/billing_id/fail_next_autocharge' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
3 "created_at": "2022-01-01T10:15:30+0000",
4 "external_id": "cst_u79lnfufjxxfdc0",
5 "id": "psrc_d3Ds20ae5VihKs092",
6 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
7 "metadata": {
8 "foo": "bar"
9 },
10 "updated_at": "2022-01-01T10:15:30+0000"
11}
Was this section helpful?