Skip to Content
Paycose Docs
Refunds

Refunds

The refund object

A refund returns all or part of a captured charge to the payer's original payment method. You create one with POST /refunds; refunds made directly at the provider also appear here once Paycose learns about them.

Attributes

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.

  • numberstringRequired

    Sequential refund number assigned when the refund is created, for display on documents and statements.

  • charge_idstringRequired

    ID of the charge this refund returns money from.

  • payment_intentstring

    ID of the payment intent the refunded charge belongs to. Omitted when the charge has no payment intent.

  • amount_from_merchantintegerRequired

    Part of amount taken back from what you received for the charge, in the smallest currency unit. 0 until the refund's balance entries are posted.

  • amount_from_appintegerRequired

    Part of amount covered by the fees and tax collected on the charge, in the smallest currency unit. 0 until the refund's balance entries are posted, and 0 when you fund the whole refund.

  • amountintegerRequired

    Amount refunded to the payer, in the smallest currency unit (for example, 49900 is 499.00 THB). Always in the charge's currency.

  • currencystringRequired

    Three-letter ISO 4217 currency code, in lowercase.

  • scaling_factorintegerRequired

    Number of smallest currency units in one major unit of currency (for example, 100 for THB), so amount / scaling_factor is the amount in major units.

  • statusenumRequired

    Where the refund is in its lifecycle. A refund is sent to the provider when it is created, so it usually leaves pending within the create call.

    • pending

      The refund was created and is waiting for the provider's final answer. It also stays pending while its outcome is unknown, until Paycose confirms it with the provider.

    • requires_action

      The provider needs further action before it can complete the refund. Only a refund in this status can be canceled.

    • succeeded

      The provider completed the refund. It can still move to failed if the provider later reports that it failed.

    • failed

      The provider declined the refund or could not be reached. failure_reason says why, and any amount already taken from your balance is returned.

    • canceled

      The refund was canceled before it completed, through the cancel endpoint or by the provider.

    • rejected

      Legacy status of refunds rejected under an earlier approval flow. New refunds never get it.

  • reasonstringRequired

    Why the refund was made: duplicate, fraudulent or requested_by_customer. Empty when no reason was given, including refunds made directly at the provider.

    • duplicate

      The charge was a duplicate.

    • fraudulent

      The charge was fraudulent.

    • requested_by_customer

      The customer asked for the refund.

  • rejection_reasonstring

    Why an older refund was rejected or canceled automatically under an earlier approval flow. Omitted on all other refunds.

  • failure_reasonstringRequiredNullable

    Why a failed or canceled refund did not complete: provider_unavailable when the provider could not be reached, declined when it refused without a code, or the provider's own error code (up to 64 characters). Null otherwise.

  • balance_transactionstringRequiredNullable

    ID of the balance transaction that took the refund from your balance. Null until the refund's balance entries are posted.

  • failure_balance_transactionstringRequiredNullable

    ID of the balance transaction that returned the refunded amount to your balance after the refund failed or was canceled. Null otherwise.

  • destinationenumRequired

    Where the refunded money goes. Every new refund uses source; wallet appears only on older refunds.

    • wallet

      Legacy. The money was credited to the customer's balance; no longer accepted for new refunds.

    • source

      The money goes back to the payer's original payment method.

  • idempotency_keystringRequired

    The Idempotency-Key header sent with the create request, or a key Paycose generated when none was sent. Retrying the create with the same key returns this refund instead of opening another.

  • requested_attimestampRequiredNullable

    Time the refund was created, in Unix seconds.

  • processed_attimestampRequiredNullable

    Time the refund reached a final status (succeeded, failed, canceled or rejected), in Unix seconds. Null while it is still pending or requires_action.

  • providerstringRequired

    Name of the payment provider that processed the refund, the same provider as the original charge.

  • reference_idstringRequired

    The provider's own identifier for the refund. Empty until the provider has accepted the refund.

  • metadataobjectRequired

    Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

  • chargeobject (charge)NullableExpandable

    The full charge object when you expand charge; otherwise omitted.

  • refund_application_feebooleanRequired

    true when the refund was created with refund_application_fee, so the matching share of the charge's application fee is returned as well.

  • reverse_transferbooleanRequired

    The reverse_transfer option the refund was created with. The option is no longer applied, so new refunds always show false.

  • application_fee_refundstringRequiredNullable

    ID of the application fee refund created when a refund with refund_application_fee succeeds. Null otherwise.

  • splitobjectRequired

    Who bears this refund: what the connected account gave back, the application fee returned to it, and what you paid.

    Show child attributes
    • split.reversedintegerRequired

      Taken back from the connected account: how much less you owe it because of this refund.

    • split.fee_returnedintegerRequired

      Application fee returned to the connected account with this refund.

    • split.from_youintegerRequired

      What the refund costs you.