Set visibility
/payment_profile/set_visibility
Target audience: Developers
Set payment profile visibility¶
Introduction¶
This endpoint sets the visible flag on a single payment profile, resolved either by its own id or by an attached order_id. The visible flag controls whether the payment profile should be displayed to the customer in your implementation.
Attention
This endpoint is gated by the enable_payment_profile_visibility rule. If the rule is not enabled for the organisation the request is rejected with a configuration error. Contact Adeprimo to have the rule enabled.
URI¶
| Environment | URI |
|---|---|
| Stage | https://payway-api.stage.adeprimo.se/external/api/v1/payment_profile/set_visibility |
| Production | https://backend.worldoftulo.com/external/api/v1/payment_profile/set_visibility |
Requirements¶
| Identity | Scope |
|---|---|
| No | /external/payment_profile/w |
Parameters¶
You are required to supply exactly one of id or order_id.
| Field | Required | Type | Description |
|---|---|---|---|
| id | No | String | The id of the payment profile Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i". |
| order_id | No | String | Resolves the profile (if any) attached to the specified order Allowed values: /\A[A-Z0-9]+-[0-9]+$/ |
| visible | Yes | Boolean | The visibility to set on the payment profile. true = visible, false = hidden. |
Curl examples¶
By id¶
curl --request PUT \
--url https://payway-api.stage.adeprimo.se/external/api/v1/payment_profile/set_visibility \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '{
"id": "6273a2c309c04cf2178b4c50",
"visible": false
}'
By order_id¶
curl --request PUT \
--url https://payway-api.stage.adeprimo.se/external/api/v1/payment_profile/set_visibility \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '{
"order_id": "ORDER-123",
"visible": false
}'
Response¶
HTTP 200 OK
{
"item": {
"id": "6273a2c309c04cf2178b4c50",
"account_id": "6273a1a609c04ceec7409c99",
"type": "adyen_scheme",
"default_profile": false,
"visible": false,
"state": "activated",
"meta_data": {
"masked_number": "123***123",
"expiry_month": "04",
"expiry_year": "2023",
"brand": "VISA"
},
"agreements": [
"ORDER-123",
"ORDER-456"
]
}
}
Errors¶
This API uses the common error conventions of the Payway API