Skip to main content

Merchant Help

 

Affirm Merchant Help

Example Code

Create checkout session
curl https://sandbox.affirm.com/api/v2/checkout/session \
     --verbose \
     -X POST \
     -u "ARQBLCL7NAMBTZ7F:RkHBmVSP5ayC2rCUujwhArpGWPxpuTtv" \
     -H "Content-Type: application/json"\
     -d '{"merchant": {"public_api_key":"ARQBLCL7NAMBTZ7F","user_cancel_url": "http://requestb.in/14h8g7c1","user_confirmation_url": "http://requestb.in/xdxxyyxd"},"items": [{"display_name": "Great product","item_url": "http://www.google.com","item_image_url": "","qty": 2,"sku": "ABC123","unit_price": 10000}],"shipping": {"address": {"city": "San Francisco","line1": "633 Folsom Street","state": "CA","zipcode": "94107"},"name":{"full":"Z"},"phone_number":"9253236612"},"billing": {"address": {"city": "San Francisco","line1": "633 Folsom Street","state": "CA","zipcode": "94107"},"email":"benmoo@gmail.com","name":{"full":"Z"},"phone_number":"9253236612"},"total": 10000}'
Retrieve card
curl https://sandbox.affirm.com/api/v2/card/
     -X POST
     -u "(public_api_key):(private_api_key)"
     -H "Content-Type: application/json"
     -d '{"card_token": "ARZBLCL7NAMBTZ2D"}'