When a checkout declines and the customer corrects their billing address, update the customer before you retry the order. The Add Order endpoint only saves the BillingAddress you send when the customer does not have one yet — for an existing customer it is ignored, and the retry goes out with the old address.
Step 1: Update the Billing Address
PUT https://openapi.admoji.com/api/v2/open/customers/{customerId}/billing-address
$ curl -X PUT 'https://openapi.admoji.com/api/v2/open/customers/16342842/billing-address' \
-H "Authorization: ApiKey secret_492796e421a34666a5695d53cd311111" \
-H "Content-Type: application/json" \
-d '{
"Address1": "13306 SW 58th Court",
"City": "Miami",
"State": "FL",
"ZipCode": "33156",
"CountryISO": "us"
}'
Accepted fields:
FirstName,LastName,Address1,Address2,City,State,ZipCode, andCountryISO.It is a partial update: only the fields you send are changed, so send just what the customer edited.
A successful call returns
{"Status": 0, "Good": true}.This endpoint needs a Full Access API key.
Step 2: Retry the Order
Send the same Add Order call again with the customer's payment details. There is no need to include BillingAddress — Admoji reads the updated address from the customer.
Idempotency-Key for the retry. Reusing the key from the declined attempt returns the cached decline instead of running the order again. See How do I generate Idempotency IDs?.Related articles