---
title: "Synchronously attempt a payment on a payment intent"
method: POST
path: "/payment-intents/{id}/payments/sync"
tags: ["Payments"]
---

# Synchronously attempt a payment on a payment intent

`POST /payment-intents/{id}/payments/sync`

This is the same endpoint but the payment is handled synchronously, it means it will wait for the provider response before returning the status of the payment intent. This endpoint is not the favored way to integrate our api and is not available for all merchants and for all providers.

## Path parameters

- `id` string, required

## Headers

- `ApiKey` string, required
- `MerchantId` string, required
- `Environment` 'live' | 'sandbox', required

## Request body

- PayDto
  - `token` string, required — The token which identify a payment intent. This is a field returned at payment intent creation.
  - `paymentMethod` 'mobile_money' | 'credit_card' | 'bank_transfer', required — The method selected by the customer to make the payment.
  - `country` string, required — Two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents the country where the selected provider is located.
  - `provider` string — The name of the selected provider in lowercase. The list of supported providers can be found at [/data/providers](#operation/DataController_getProviders). If type is 'bank_transfer', provider will be optionnal and will be a bank name
  - `mobileMoney` PayMobileMoneyDto
    - `msisdn` string, required — The phone number associated to the Mobile Money account used to make the transaction.
    - `otp` string — Some providers ask the customer to generate an OTP to allow the payment. Hub2 handle this in a two-step process if the selected provider ask for an OTP. But in some case, the client prefers to make a one-step process in which the payment and the authentication are done at same time. Hub2 allows this by accepting an OTP to be provided during the payment attempt step.
    - `onSuccessRedirectionUrl` string — Only for payment using provider Wave. The URL the customer will be directed to if the payment succeeds. You must provide a fully-qualified address using https as the scheme. You may include any information you need in the path itself or in query parameters.
    - `onFailedRedirectionUrl` string — Only for payment using provider Wave. The URL the customer will be directed to if an error occurs on the payment attempt. You must provide a fully-qualified address using https as the scheme. You may include any information you need in the path itself or in query parameters.
    - `onCancelRedirectionUrl` string — Only for payment using provider Orange with the redirection workflow. The URL the customer will be directed to if he cancels the payment. You must provide a fully-qualified address using https as the scheme. You may include any information you need in the path itself or in query parameters.
    - `onFinishRedirectionUrl` string — Only for payment using provider Orange with the redirection workflow. The URL the customer will be directed to when the payment finish and the return link is clicked. You must provide a fully-qualified address using https as the scheme. You may include any information you need in the path itself or in query parameters.
    - `workflow` string — Only for payment using provider Orange. If you choose to set this parameter to 'redirection', you will be provided a redirection URL. Your clients must be redirected to this url for them to finalize payment. Otherwise it will follow our conventional workflow with OTP.
  - `creditCard` PayCreditCardDto
    - `billing` PayCreditCardBilling
      - `username` string — Username of the customer
      - `userId` string — User ID of the customer
      - `phoneNumber` string — The phone number of the customer
      - `email` string — The email of the customer
      - `orderId` string — The order ID associated with the transaction
    - `useHub2ReceiptPage` boolean — When set to true, Hub2 receipt page is displayed after payment
    - `onSuccessRedirectionUrl` string — The url used to redirect the user when the transaction is successful
    - `onFailedRedirectionUrl` string — The url used to redirect the user when the transaction is failed
  - `bankTransfer` PayBankTransferDto
    - `expirationDelay` number — Number of seconds until the payment expires.
    - `kybName` string, required — Name of the aggregated merchant declared in the kyb
  - `overrideBusinessId` string — This field is mandatory for merchants that have the corresponding setting enabled, It allows to send a custom name
  - `paymentInformation` PaymentInformationDto
    - `recipient_name_hashmac` string — HMAC or hashed full name of the person receiving the funds. Send only hashed or pseudonymized values; do not send raw personal data.
    - `recipient_phone_hashmac` string — HMAC or hashed MSISDN of the recipient (natural identifier for mobile money). Send only a partner-side hash or HMAC — clear phone numbers are rejected.
    - `customer_id_hashmac` string — Partner-side hashed customer identifier. Use when name or phone hashes are not available, to correlate transactions for fraud analysis.
    - `transaction_purpose` 'SALARY' | 'LOAN_DISBURSEMENT' | 'COMMISSION' | 'REFUND' | 'CASHOUT' | 'OTHER' — Declared purpose of the payment for compliance and reporting.

## Response `201`

- PaymentIntentDto
  - `id` string, required — Unique identifier for the PaymentIntent
  - `merchantId` string, required — Identifier of the merchant owning this PaymentIntent
  - `createdAt` string, required — Datetime in UTC timezone at which this object was created. Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
  - `updatedAt` string, required — Datetime in UTC timezone at which this object was updated for the last time . Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
  - `token` string, required — A unique [JSON Web Token](https://en.wikipedia.org/wiki/JSON_Web_Token) allowing to attempt a Payment on the PaymentIntent on a client-side application.
  - `purchaseReference` string, required — A reference provided by the client during the creation of this PaymentIntent
  - `customerReference` string, required — A reference provided by the client during the creation of this PaymentIntent. It is a reference to the customer for who this PaymentIntent was created.
  - `status` 'action_required' | 'canceled' | 'failed' | 'payment_required' | 'processing' | 'successful', required — The current status of this PaymentIntent
  - `amount` number, required — Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
  - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
  - `payments` union[], required — List of Payment attempts made on this PaymentIntent
    - union
      - PaymentCreditCardDto
        - `id` string, required — Unique identifier for the Payment
        - `intentId` string, required — Unique identifier for the PaymentIntent owning this Payment
        - `createdAt` string, required — Datetime in UTC timezone at which this object was created. Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
        - `updatedAt` string, required — Datetime in UTC timezone at which this object was updated for the last time . Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
        - `status` 'created' | 'failed' | 'pending' | 'successful', required — Current status of this Payment
        - `amount` number, required — Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
        - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
        - `method` 'mobile_money' | 'credit_card' | 'bank_transfer', required — The method selected by the customer to make this Payment
        - `country` string, required — Two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents the country where the provider selected by the customer is localized.
        - `failure` PaymentFailureCauseDto
          - `code` 'internal_error' | 'service_unavailable' | 'unknown_reason' | 'customer_account_locked' | 'customer_insufficient_funds' | 'authentication_failed' | 'authentication_timeout' | 'timeout' | 'bad_parameters' | 'forbidden_by_provider' | 'too_many_request' | 'duplicate_request' | 'canceled_by_customer' | 'canceled' | 'fraud_suspicion' | 'unsupported_currency' | 'payer_quota_exceeded' | 'invalid_payment_processor' | 'invalid_amount' | 'blacklisted_msisdn' | 'msisdn_invalid' | 'card_expired' | 'card_declined' | 'card_stolen' | 'card_refused' | 'card_invalid' | 'card_cvn_invalid' | 'address_verification_failed' | 'payment_limit_reached', required — Unique code representing the failure cause for the payment.
          - `message` string, required — Human readable message explaining the failure cause. This message can be displayed to the customer.
          - `params` string[] — List of parameters causing the payment failure in case of invalid parameters
        - `fees` PaymentFeeDto[], required — Some fees may be applied on a Payment. This array provides information of the fees that could have been applied on this Payment.
          - `id` string, required — Unique identifier of the applied Fee object.
          - `rate` number, required — A rate corresponding to the amount (flat or percentage) applied by the fees.
          - `rateType` 'percent' | 'flat', required — Fees can either be a flat amount of the transaction amount or percentage of the transaction amount.
          - `amount` number, required — Amount applied by this Fees. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
          - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
          - `label` string — An optional label giving information on the reason of this fees.
          - `taxes` string[] — Taxes applied to this fee.
        - `nextAction` NextActionDto
          - `type` 'ussd' | 'otp' | 'redirection', required
          - `message` string, required
          - `data` RedirectionDataDto
            - `url` string, required — A fully qualified URL where the customer must be redirected to pursue the payment.
            - `urls` string, required — An array of fully qualified URLs where the customer must be redirected to pursue the payment.
            - `method` string, required — HTTP verb to be used to redirect the customer.
            - `headers` object
            - `data` object — Data that need to be used to make the redirection. It could be parameters for a GET request or a body payload for a POST.
        - `providerReference` string, required — provider reference that identify this payment
        - `gatewayId` string, required — gatewayId used for this payment (Mobile Money Only)
        - `number` string, required — The identifier referencing the payment method of the customer. - In case of a payment by Mobile Money, it corresponds to the customer phone number corresponding to his Mobile Money account, - In case of a payment by Credit Card, it corresponds to the four last digits of the customer's credit card number.
        - `paymentInformation` PaymentInformationDto
          - `recipient_name_hashmac` string — HMAC or hashed full name of the person receiving the funds. Send only hashed or pseudonymized values; do not send raw personal data.
          - `recipient_phone_hashmac` string — HMAC or hashed MSISDN of the recipient (natural identifier for mobile money). Send only a partner-side hash or HMAC — clear phone numbers are rejected.
          - `customer_id_hashmac` string — Partner-side hashed customer identifier. Use when name or phone hashes are not available, to correlate transactions for fraud analysis.
          - `transaction_purpose` 'SALARY' | 'LOAN_DISBURSEMENT' | 'COMMISSION' | 'REFUND' | 'CASHOUT' | 'OTHER' — Declared purpose of the payment for compliance and reporting.
        - `isDelegated` boolean — Indicates whether this payment is a delegated payment.
        - `onSuccessRedirectionUrl` string, required — The url used to redirect the user after a transaction is successful.
        - `onFailedRedirectionUrl` string, required — The url used to redirect the user after a transaction fails
        - `billing` object, required — Informations about order and credit card owner
      - PaymentMobileMoneyDto
        - `id` string, required — Unique identifier for the Payment
        - `intentId` string, required — Unique identifier for the PaymentIntent owning this Payment
        - `createdAt` string, required — Datetime in UTC timezone at which this object was created. Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
        - `updatedAt` string, required — Datetime in UTC timezone at which this object was updated for the last time . Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
        - `status` 'created' | 'failed' | 'pending' | 'successful', required — Current status of this Payment
        - `amount` number, required — Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
        - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
        - `method` 'mobile_money' | 'credit_card' | 'bank_transfer', required — The method selected by the customer to make this Payment
        - `country` string, required — Two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents the country where the provider selected by the customer is localized.
        - `failure` PaymentFailureCauseDto
          - `code` 'internal_error' | 'service_unavailable' | 'unknown_reason' | 'customer_account_locked' | 'customer_insufficient_funds' | 'authentication_failed' | 'authentication_timeout' | 'timeout' | 'bad_parameters' | 'forbidden_by_provider' | 'too_many_request' | 'duplicate_request' | 'canceled_by_customer' | 'canceled' | 'fraud_suspicion' | 'unsupported_currency' | 'payer_quota_exceeded' | 'invalid_payment_processor' | 'invalid_amount' | 'blacklisted_msisdn' | 'msisdn_invalid' | 'card_expired' | 'card_declined' | 'card_stolen' | 'card_refused' | 'card_invalid' | 'card_cvn_invalid' | 'address_verification_failed' | 'payment_limit_reached', required — Unique code representing the failure cause for the payment.
          - `message` string, required — Human readable message explaining the failure cause. This message can be displayed to the customer.
          - `params` string[] — List of parameters causing the payment failure in case of invalid parameters
        - `fees` PaymentFeeDto[], required — Some fees may be applied on a Payment. This array provides information of the fees that could have been applied on this Payment.
          - `id` string, required — Unique identifier of the applied Fee object.
          - `rate` number, required — A rate corresponding to the amount (flat or percentage) applied by the fees.
          - `rateType` 'percent' | 'flat', required — Fees can either be a flat amount of the transaction amount or percentage of the transaction amount.
          - `amount` number, required — Amount applied by this Fees. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
          - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
          - `label` string — An optional label giving information on the reason of this fees.
          - `taxes` string[] — Taxes applied to this fee.
        - `nextAction` NextActionDto
          - `type` 'ussd' | 'otp' | 'redirection', required
          - `message` string, required
          - `data` RedirectionDataDto
            - `url` string, required — A fully qualified URL where the customer must be redirected to pursue the payment.
            - `urls` string, required — An array of fully qualified URLs where the customer must be redirected to pursue the payment.
            - `method` string, required — HTTP verb to be used to redirect the customer.
            - `headers` object
            - `data` object — Data that need to be used to make the redirection. It could be parameters for a GET request or a body payload for a POST.
        - `providerReference` string, required — provider reference that identify this payment
        - `gatewayId` string, required — gatewayId used for this payment (Mobile Money Only)
        - `number` string, required — The identifier referencing the payment method of the customer. - In case of a payment by Mobile Money, it corresponds to the customer phone number corresponding to his Mobile Money account, - In case of a payment by Credit Card, it corresponds to the four last digits of the customer's credit card number.
        - `paymentInformation` PaymentInformationDto
          - `recipient_name_hashmac` string — HMAC or hashed full name of the person receiving the funds. Send only hashed or pseudonymized values; do not send raw personal data.
          - `recipient_phone_hashmac` string — HMAC or hashed MSISDN of the recipient (natural identifier for mobile money). Send only a partner-side hash or HMAC — clear phone numbers are rejected.
          - `customer_id_hashmac` string — Partner-side hashed customer identifier. Use when name or phone hashes are not available, to correlate transactions for fraud analysis.
          - `transaction_purpose` 'SALARY' | 'LOAN_DISBURSEMENT' | 'COMMISSION' | 'REFUND' | 'CASHOUT' | 'OTHER' — Declared purpose of the payment for compliance and reporting.
        - `isDelegated` boolean — Indicates whether this payment is a delegated payment.
        - `provider` string, required — The name of the provider selected by the customer, in lowercase. The list of supported providers can be found at [/data/providers](#operation/DataController_getProviders)
      - PaymentBankTransferDto
        - `id` string, required — Unique identifier for the Payment
        - `intentId` string, required — Unique identifier for the PaymentIntent owning this Payment
        - `createdAt` string, required — Datetime in UTC timezone at which this object was created. Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
        - `updatedAt` string, required — Datetime in UTC timezone at which this object was updated for the last time . Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
        - `status` 'created' | 'failed' | 'pending' | 'successful', required — Current status of this Payment
        - `amount` number, required — Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
        - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
        - `method` 'mobile_money' | 'credit_card' | 'bank_transfer', required — The method selected by the customer to make this Payment
        - `country` string, required — Two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Represents the country where the provider selected by the customer is localized.
        - `failure` PaymentFailureCauseDto
          - `code` 'internal_error' | 'service_unavailable' | 'unknown_reason' | 'customer_account_locked' | 'customer_insufficient_funds' | 'authentication_failed' | 'authentication_timeout' | 'timeout' | 'bad_parameters' | 'forbidden_by_provider' | 'too_many_request' | 'duplicate_request' | 'canceled_by_customer' | 'canceled' | 'fraud_suspicion' | 'unsupported_currency' | 'payer_quota_exceeded' | 'invalid_payment_processor' | 'invalid_amount' | 'blacklisted_msisdn' | 'msisdn_invalid' | 'card_expired' | 'card_declined' | 'card_stolen' | 'card_refused' | 'card_invalid' | 'card_cvn_invalid' | 'address_verification_failed' | 'payment_limit_reached', required — Unique code representing the failure cause for the payment.
          - `message` string, required — Human readable message explaining the failure cause. This message can be displayed to the customer.
          - `params` string[] — List of parameters causing the payment failure in case of invalid parameters
        - `fees` PaymentFeeDto[], required — Some fees may be applied on a Payment. This array provides information of the fees that could have been applied on this Payment.
          - `id` string, required — Unique identifier of the applied Fee object.
          - `rate` number, required — A rate corresponding to the amount (flat or percentage) applied by the fees.
          - `rateType` 'percent' | 'flat', required — Fees can either be a flat amount of the transaction amount or percentage of the transaction amount.
          - `amount` number, required — Amount applied by this Fees. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge €1.00 or 100 to charge FCFA100, a zero-decimal currency).
          - `currency` string, required — Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html).
          - `label` string — An optional label giving information on the reason of this fees.
          - `taxes` string[] — Taxes applied to this fee.
        - `nextAction` NextActionDto
          - `type` 'ussd' | 'otp' | 'redirection', required
          - `message` string, required
          - `data` RedirectionDataDto
            - `url` string, required — A fully qualified URL where the customer must be redirected to pursue the payment.
            - `urls` string, required — An array of fully qualified URLs where the customer must be redirected to pursue the payment.
            - `method` string, required — HTTP verb to be used to redirect the customer.
            - `headers` object
            - `data` object — Data that need to be used to make the redirection. It could be parameters for a GET request or a body payload for a POST.
        - `providerReference` string, required — provider reference that identify this payment
        - `gatewayId` string, required — gatewayId used for this payment (Mobile Money Only)
        - `number` string, required — The identifier referencing the payment method of the customer. - In case of a payment by Mobile Money, it corresponds to the customer phone number corresponding to his Mobile Money account, - In case of a payment by Credit Card, it corresponds to the four last digits of the customer's credit card number.
        - `paymentInformation` PaymentInformationDto
          - `recipient_name_hashmac` string — HMAC or hashed full name of the person receiving the funds. Send only hashed or pseudonymized values; do not send raw personal data.
          - `recipient_phone_hashmac` string — HMAC or hashed MSISDN of the recipient (natural identifier for mobile money). Send only a partner-side hash or HMAC — clear phone numbers are rejected.
          - `customer_id_hashmac` string — Partner-side hashed customer identifier. Use when name or phone hashes are not available, to correlate transactions for fraud analysis.
          - `transaction_purpose` 'SALARY' | 'LOAN_DISBURSEMENT' | 'COMMISSION' | 'REFUND' | 'CASHOUT' | 'OTHER' — Declared purpose of the payment for compliance and reporting.
        - `isDelegated` boolean — Indicates whether this payment is a delegated payment.
        - `provider` string, required — The name of the provider (bank) selected by the customer, in lowercase. The list of supported providers can be found at [/data/providers](#operation/DataController_getProviders)
        - `bankTransferReference` string, required — Reference that must be used to make the bank transfer
        - `expirationDate` string, date-time, required — Datetime in UTC timezone at which this payment will expire. Follows the [Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601).
  - `mode` 'live' | 'sandbox', required — Mode in which this PaymentIntent exists. The sandbox mode can be used during the integration phase and is available as soon as the merchant account is created. No real transactions are made in this mode. The live mode has to be used to make real transactions.
  - `nextAction` NextActionDto
    - `type` 'ussd' | 'otp' | 'redirection', required
    - `message` string, required
    - `data` RedirectionDataDto
      - `url` string, required — A fully qualified URL where the customer must be redirected to pursue the payment.
      - `urls` string, required — An array of fully qualified URLs where the customer must be redirected to pursue the payment.
      - `method` string, required — HTTP verb to be used to redirect the customer.
      - `headers` object
      - `data` object — Data that need to be used to make the redirection. It could be parameters for a GET request or a body payload for a POST.
  - `lastPaymentFailure` PaymentFailureCauseDto
    - `code` 'internal_error' | 'service_unavailable' | 'unknown_reason' | 'customer_account_locked' | 'customer_insufficient_funds' | 'authentication_failed' | 'authentication_timeout' | 'timeout' | 'bad_parameters' | 'forbidden_by_provider' | 'too_many_request' | 'duplicate_request' | 'canceled_by_customer' | 'canceled' | 'fraud_suspicion' | 'unsupported_currency' | 'payer_quota_exceeded' | 'invalid_payment_processor' | 'invalid_amount' | 'blacklisted_msisdn' | 'msisdn_invalid' | 'card_expired' | 'card_declined' | 'card_stolen' | 'card_refused' | 'card_invalid' | 'card_cvn_invalid' | 'address_verification_failed' | 'payment_limit_reached', required — Unique code representing the failure cause for the payment.
    - `message` string, required — Human readable message explaining the failure cause. This message can be displayed to the customer.
    - `params` string[] — List of parameters causing the payment failure in case of invalid parameters
  - `overrideBusinessName` string — For Aggregator, name of the merchant
  - `subMerchantId` string — Submerchant ID

## Other responses

- `400` — Bad Request
- `401` — Wrong credentials
- `404` — Not Found
- `409` — Invalid request
- `422` — Unprocessable Entity
- `429` — ThrottlerException: Too Many Requests
- `500` — Internal error
- `502` — Invalid gateway

---

[API](https://skmtc.net/hub2/apis/hub2-service-api.md) · [All operations](https://skmtc.net/hub2/apis/hub2-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hub2/hub2-service-api/revisions/adb17b4b80f4/schema)
