m2pfintech
API LibraryCustomer

Update Customer Promocode

Adds, updates, or deletes a promo code for a customer. Promo codes control fee waivers, special rates, and promotional offers tied to a customer's card product.

Actions

ActionDescription
ADDAssign a new promo code
UPDATEChange to a different promo code
DELETERemove the existing promo code

Validations

  • Promo code's product must match customer's product
  • Cannot delete if customer has no promo code
POST
/v1/customers/update/promocode

Authorization

bearerAuth tenantId
AuthorizationBearer <token>

JWT Bearer token from the Authentication API

In: header

X-TENANT-ID<token>

Your unique tenant identifier assigned during onboarding

In: header

Header Parameters

X-TENANT-ID*string

Your unique tenant identifier

Request Body

application/json

entityId*string

Required. Customer entity ID

kit*string

Required. Card kit number

promocodeId*string

Required. Promo code identifier

action?string

Required. Operation to perform

Value in"ADD" | "DELETE" | "UPDATE"

Response Body

application/json

application/json

application/json

curl -X POST "https://sandbox-api.m2pprepaid.com/prepaid/customer/v1/customers/update/promocode" \  -H "X-TENANT-ID: ACME_CORP" \  -H "Content-Type: application/json" \  -d '{    "entityId": "615928984620006085281025",    "kit": "20006085",    "promocodeId": "PROMO789",    "action": "ADD"  }'
{
  "result": "Promo code updated successfully",
  "pagination": null
}
{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Bad Request",
  "status": 400,
  "detail": "Unable to convert http message",
  "message": "error.http.400"
}

{
  "type": "https://www.m2pfintech.com/problem/problem-with-message",
  "title": "Promocode productId does not match with customers productId",
  "status": 409,
  "detail": "Promocode productId does not match with customers productId",
  "message": "error.business",
  "businessCode": "PPCUST_125"
}