Ga naar de inhoud
agovena.
agovena.
Aan de slag
Community

API-overzicht

Sla een klantadres op

Kies een handeling voor het request, responsestructuur, toegangsregels en implementatiebron.

SchrijvenGeauthenticeerd

POST/api/v1/addresses

Sla een klantadres op

Sanctum-sessie of bearer-token. Vereiste bearer-bevoegdheid: addresses.create

Verzoek
VeldInRegel
name, line1JSON-bodyVerplichte strings; elk maximaal 255 tekens.
cityJSON-bodyVerplichte string; maximaal 120.
postal_codeJSON-bodyVerplichte string; maximaal 20.
countryJSON-bodyVerplichte string; precies 2 tekens.
labelJSON-bodyNullable string; maximaal 80.
company, line2JSON-bodyNullable strings; elk maximaal 255.
regionJSON-bodyNullable string; maximaal 120.
phoneJSON-bodyNullable string; maximaal 40.
is_default_billing, is_default_shippingJSON-bodyOptionele booleans; weggelaten vlaggen worden false, ook bij PATCH.
propertiesJSON-bodyNullable array. Ondersteunde aliassen en voorrang: zie het adresschema hieronder.
cURL
curl --request POST "https://shop.example.test/api/v1/addresses" \
  --header 'Accept: application/json' \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{"name":"Alex Example","line1":"Example Street 1","city":"Brussels","postal_code":"1000","country":"BE"}'
Antwoord200
Succes: 200

Responsestructuur (notatie, geen opgenomen antwoord)

schema
{ data: Address }

Volledig responseschema

Gebruikelijke fouten
HTTP-statusBetekenis
401unauthenticated: ontbrekende of ongeldige authenticatie.
403unauthorized, insufficient_scope of ip_not_allowed: controleer klantcontext, bevoegdheid en token-IP-beleid.
422validation_error: ongeldige invoer of niet-vervulde domeinvereisten. Betaalinitiatie kan ook payment_failed geven.
429rate_limited: wacht voor een nieuwe poging, vooral bij schrijfverzoeken.
Foutstructuur en globale aandachtspunten

Doorzoek de documentatie

Zoek handleidingen, commando’s en API-endpoints

Waar ben je naar op zoek?

Documentatie