Configurer une carte virtuelle pour utilisation en magasin

Générez des cartes virtuelles Affirm à partir de votre système de point de vente (POS) pour offrir des options de paiement flexibles aux clients en magasin. Découvrez comment initier des paiements, envoyer des liens de paiement, autoriser des transactions et gérer des commandes pour une expérience client fluide.

Conditions préalables

Étapes

1. Initier la caisse en magasin

Sales associate selects Affirm as a payment option from your point-of-sale (PoS) system. This action triggers a request to Affirm to text or email a checkout link to the customer directly.

When the customer checks out, your client sends their order details client-side to Affirm. Then, we render the checkout experience for the customer. Lastly, we return a checkout_token in the success callback on their loan confirmation.

When building the checkout object for the Virtual Card In-Store flow, set the use_vcn attribute to true on the merchant object.

POST /api/v2/checkout/store HTTP/1.1
Host: sandbox.affirm.com
Content-Type: application/json

{
      "merchant": {
        "public_api_key":               "PUBLIC_API_KEY",
        "user_cancel_url":				"https://www.google.com",
        "user_confirmation_url":        "https://www.affirm.com",
        "user_confirmation_url_action": "POST",
       "name":                         "In-store Affirm demo"
      },
      "billing":{
        "name":{
          "full":                        "John Doe"
        },
        "address":{
          "line1":                       "325 Pacific Ave",
          "city":                        "San Francisco",
          "state":                       "CA",
          "zipcode":                     "94112",
          "country":                     "USA"
        },
        "phone_number":                  "4155552222",
        "email":                         "[email protected]"
      },
  "metadata": {
    "entity_name": "Vignan 1234",
    "store_location": "Denver"
  },
      "order_id":                        "00de5cee-7226-4aec-b729-a571f773a58c",
      "total":                           5000         
  }
🚧

Réception de l’URL de paiement

L'API Store n'enverra des SMS que dans l'environnement Affirm Live. Pendant les tests de l'environnement Sandbox, veuillez vous fier aux messages électroniques pour recevoir l'URL de paiement, afin de finaliser votre achat Affirm.

2. Événement de confirmation du webhook

When a user confirms their loan, Affirm's server is notified of that event. We POST the checkout_id back to your server at the webhook URL you provide.

3. Créer une commande

Affirm's server POSTs a checkout event containing the checkout_id back to your server. This checkout_id, also called the transaction_id, must be authorized securely before you save the order or update the order's status on the in-store terminal.

4. Confirmation en magasin

Une fois la commande autorisée, le terminal en magasin doit être en mesure de recevoir la confirmation de commande et d’indiquer le statut de paiement en temps quasi réel.

5. Gérer la commande

You can initiate different transaction actions depending on your internal processes.

Quelle est la prochaine étape?