Create checkout
create_checkoutCreate the order and get a hosted payment link for a chosen offer. Call this as soon as the user picks an offer + shipping speed — do NOT ask for their address first: the secure payment page collects the shipping address and email. Only pass address fields if the user already volunteered them. Returns checkout_url — give it to the user to pay; UFP places the vendor order automatically after payment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | ||
| city | No | ||
| name | No | Recipient full name (only if the user provided it) | |
| No | Buyer email (only if the user provided it) | ||
| phone | No | ||
| state | No | Two-letter US state | |
| street1 | No | Street address (only if the user provided it) | |
| street2 | No | ||
| offer_id | Yes | ||
| return_url | No | Exact URL of the page the user is on right now, IF the client application knows it (a web app embedding this tool passes its own page URL). The post-payment page shows a 'Return to <site>' button pointing here. Omit when unknown — never invent one. | |
| billing_zip | No | ||
| coupon_code | No | Coupon code, only if the user provided one (early-adopter codes from the AFN team). Case-insensitive. The discount appears on the payment page; a 100%-off code makes the total $0 with no card required. Never invent or guess a code. | |
| billing_city | No | ||
| billing_name | No | Billing address, only when the buyer answered the billing question (e.g. said it differs from shipping, or a checkout UI's 'same as shipping' checkbox — then send the shipping values verbatim). Never ask for it; omit and the payment page handles billing. | |
| billing_state | No | Two-letter US state | |
| billing_street1 | No | ||
| billing_street2 | No | ||
| shipping_option_id | Yes | One of the offer's shipping option ids |