Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Partially update a card

Updates one or more fields of a card. Every field may be omitted, and an omitted field keeps its stored value — with one exception.

Important: slug is the exception. When it is left out of a partial update, the code is derived again from the name rather than kept — from the name sent in the request if there is one, and from the stored name otherwise. A request that changes only is_commerce_card therefore still rewrites the code to the derived form of the card's current name. If the card's code does not already match that form, include slug in every partial update. See The Code of a Card.

The code the card ends up with must not belong to another card of the same bank, and the combination of bank, card_type and card_payment_type it ends up with must not belong to another card. For that second rule the fields that were not sent are taken from the stored card.

patch
/cards/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the card.

Body

Request body for partially updating a card. Every field is optional, and an omitted field keeps its stored value — except slug, which is derived again from the name when it is left out. See The Code of a Card before sending a partial update that leaves the code out.

namestring · max: 64Optional

Display name of the card. When this is sent without slug, the code of the card is derived from this new name.

Example: Example Card
slugstring · max: 64Optional

The code that identifies the card within its bank. May contain only letters, digits, underscores and hyphens.

Leaving this out does not keep the stored code: it is derived again from the name — from name if that is part of this request, and from the stored name otherwise. Include it whenever the card's code must stay as it is.

Example: example-card
bankintegerOptional

Identifier of the bank the card belongs to. When the bank is changed here, the code is still checked against the cards of the previous bank rather than the new one.

Example: 3
card_typeintegerOptional

Identifier of the card type.

Example: 1
card_payment_typestring · enumOptional

Whether a card is a credit or a debit card.

  • credit — a credit card. A card stored without a payment type is treated as one.
  • debit — a debit card. While THREE_D_REDIRECT_DEBIT is on, which is the default, every payment matched to a card marked this way is redirected to 3D secure verification.
Example: creditPossible values:
cash_paymentintegerOptional

Identifier of the POS terminal a single, non-installment payment is sent through.

Example: 5
installment_paymentintegerOptional

Identifier of the POS terminal an installment payment is sent through.

Example: 5
three_d_paymentinteger · nullableOptional

Identifier of the POS terminal used when a single payment is redirected to 3D secure verification. Send null to remove the assignment.

Example: 6
installment_three_d_paymentinteger · nullableOptional

Identifier of the POS terminal used when an installment payment is redirected to 3D secure verification. Send null to remove the assignment.

Example: 6
is_commerce_cardboolean · nullableOptional

Whether the card is the store's own commerce card.

Example: true
Responses
200

The updated card.

application/json

A card returned by the API — the record that describes a payment card the store accepts and states which POS terminal each kind of payment made with it is sent through. The bank, the card type and the four terminal fields are returned as identifiers rather than nested objects.

pkintegerRead-onlyRequired

Unique identifier of the card.

namestring · max: 64Required

Display name of the card.

Example: Example Card
slugstring · max: 64Required

The code that identifies the card within its bank. Unique among the cards of the same bank, but the same code may be used by cards of other banks.

Example: example-card
bankintegerRequired

Identifier of the bank the card belongs to.

Example: 3
card_typeintegerRequired

Identifier of the card type — the scheme or programme of the card.

Example: 1
card_payment_typestring · enumRequired

Whether a card is a credit or a debit card.

  • credit — a credit card. A card stored without a payment type is treated as one.
  • debit — a debit card. While THREE_D_REDIRECT_DEBIT is on, which is the default, every payment matched to a card marked this way is redirected to 3D secure verification.
Example: creditPossible values:
cash_paymentintegerRequired

Identifier of the POS terminal a single, non-installment payment is sent through.

Example: 5
installment_paymentintegerRequired

Identifier of the POS terminal an installment payment is sent through.

Example: 5
three_d_paymentinteger · nullableRequired

Identifier of the POS terminal used when a single payment is redirected to 3D secure verification, or null when the card has none. Never used while THREE_D_SECURE_ENABLED is off.

Example: 6
installment_three_d_paymentinteger · nullableRequired

Identifier of the POS terminal used when an installment payment is redirected to 3D secure verification, or null when the card has none.

Example: 6
is_commerce_cardboolean · nullableRequired

Whether the card is the store's own commerce card. Read by the commerce-card installment filters, and without effect while none of them is configured through INSTALLMENT_FILTERS.

Example: false
patch/cards/{id}/
PATCH /api/v1/remote/1/cards/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 214

{
  "name": "Example Card",
  "slug": "example-card",
  "bank": 3,
  "card_type": 1,
  "card_payment_type": "credit",
  "cash_payment": 5,
  "installment_payment": 5,
  "three_d_payment": 6,
  "installment_three_d_payment": 6,
  "is_commerce_card": true
}
{
  "pk": 1,
  "name": "Example Card",
  "slug": "example-card",
  "bank": 3,
  "card_type": 1,
  "card_payment_type": "credit",
  "cash_payment": 5,
  "installment_payment": 5,
  "three_d_payment": 6,
  "installment_three_d_payment": 6,
  "is_commerce_card": false
}

Last updated

Was this helpful?